Comments

Blake blake at kingdomrpg.com
Wed Sep 12 06:43:55 UTC 2007


On Tue, 11 Sep 2007 22:19:17 -0700, tim Rowledge <tim at rowledge.org> wrote:

> Actually in general I *do* want a comment in accessors; not a simple  
> minded one though. Y'see I don't *like* simple accessors. Instance  
> variables are there for a reason and they're not publicly accessible for  
> another reason.A method that opens up my object to rape and pillage damn  
> well *should* be commented. A class where all the instvars have  
> accessors is generally going to be horribly abused. I mean, what is this  
> ? C++? Gimme a break. People will be trying to tell me that Squeak must  
> have an "access path notation for variable members" next. If I'm  
> supposed to be exposing my programmatic buttocks to the world I want a   
> comment to explain why!

That sounds good.

But, really, how do you apply it in practice to something like the read  
accessors to "numerator" and "denominator" in Fraction?

Some accessors really are both necessary, simple and not needing  
documentation.



More information about the Squeak-dev mailing list