Print Page | Close Window

Public member variables...

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8613
Printed Date: 16 May 2024 at 7:16am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Public member variables...
Posted By: znakeeye
Subject: Public member variables...
Date 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!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net