|
|
Advice: Default to Protected
I don't currently code in Python, but this reminded me of something I run into regularly in Java: While this is worded badly, it's trying to say that most instance variables should be private and all private variables should start with an underscore. (i.e. when in doubt make it private) My rule, for Java, is that no instance variable should be made private unless you have a protected or public getter/setter wrappers for that ivar. Since many ivars don't deserve such a wrapper, I make them protected. Why?
Friday, March 14, 2003
|
Contact Me Topics RSS Feed Linkblog
Bill Bumgarner Brent Simmons Daniel Jalkut Dave Dribin Eric Albert Eric Rescorla Eric Sink Greg Miller Gus Mueller Jeremy Zawodny John Gruber Mark Dalrymple Michael Tsai Peter Ammon Raymond Chen Ryan Wilcox Scott Stevenson Steven Frank The Daily WTF we hates software Wil Shipley |
Copyright © 1997-2008 Jonathan 'Wolf' Rentzsch. All rights reserved.
Questions? Comments? Contact Me.