Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Public member variables...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Public member variables...

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Public member variables...
    Posted: 31 October 2007 at 5:30am

Why do you keep some member variables public? I think it's time to add those Get/Set-functions and hide them!

GetImageManager()->m_blabla ...
1) Bad design. Period!
2) It looks awful.
3) A Set-method makes it easier to debug variable assignments and a Get-method sure makes it a lot easier to track down where the variable is being used.
 
Member variables that cannot be subclassed should always be private and always accessed via the Get-function!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.