[Seaside] A new critical blog discussing Seaside - Using getters/setters

Travis Griggs travisgriggs at gmail.com
Sun Apr 19 01:26:48 UTC 2009


On Apr 18, 2009, at 10:25 AM, Michael Lucas-Smith wrote:

> You don't like "political correctness" which is fine, I don't like  
> it either.. I do though think there is a thing called politeness,  
> which is how I personally try to hamstring my communications.
>
> What I'm seeing a lot of on your blog and on your posts here is your  
> personal opinion on certain engineering practices that you'retelling  
> other people to do. Do you realize that people don't like being told  
> how to think? There are many many "politically incorrect" words one  
> can apply to somebody who does that.
>
> Anyway, my minor rant about your approach to communicating with  
> people aside, on the matter of direct instance variable access, my  
> personal development style, opinion and likes/dislikes lend toward  
> using direct instance variable access wherever possible.
>
> For me, providing an accessor to a variable is like saying "this is  
> not my personal encapsulated state, it is something you can fiddle  
> with". That makes an accessor public API to me, so I won't create it  
> unless I really mean it.
>
> The behavior of code on my class generally accesses the instance  
> variables directly for a few reasons:
> a) Each object is its own "cell" (biology terms), it is already  
> encapsulated
> b) The object has no need to lie to itself (ie: have the accessor  
> return something other than the variable itself)
> c) Sending 'self' to yourself is a tad psychotic at times. it's a  
> bit like type declarations in other programming languages.. how many  
> times do you want me to repeat myself exactly?
>
> So there you have it. I don't agree with you - now you can vilify me  
> too. Have at it.


I agree with you Michael.

I'll throw another one in the mix. I don't like lazy accessors. In  
particular I do not care for the way the VW UI Builder stuff engages  
them. Time and time again over the years, I have had to fix difficult  
bugs because of inconsistencies in initialization graphs. I prefer a  
"say what you're going to do" approach, like set them in the  
initialize method if possible. Using lazy accessors for things like  
ValueHolders just litters extra code all over the place, makes change  
notification initializations hard to find, etc. My conclusions are  
based on doing quite a bit of this for quite a while. Just because you  
*can* do clever things in Smalltalk, doesn't always mean you *should*  
do them. OTOH, I like to use lazy initializers for things class  
shares. Inconsistent of me? Maybe. It's a practice that has been honed  
by, er, uh, practice. As always, there are no absolute answers. Use  
the right tool for the right job, apply the right (coding) religion at  
the right time.

There, I've taken issue with another one of the points. I'd like to be  
vilified with Michael.

--
Travis Griggs
Objologist
My Other Machine runs OSX. But then... so does this one.





More information about the seaside mailing list