Public member variables... |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |