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

Michael Lucas-Smith mlucas-smith at cincom.com
Sat Apr 18 17:25:48 UTC 2009


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.

Michael

TheSmalltalkBlog at gmx.ch wrote:
> Thank you for these statements confirming my proposals:
>
>   
>> It is a fact that many squeak codings usually access instance variables 
>> directly, what makes some coding hard to read and to understand.
>>     
>
> Conclusion:
>
> It would be very simple to use accessor methods in Squeak and it's generally a good idea - not my (C) btw. 
>
> I fully agree!
>
> So why aren't the Seaside authors willing to learn from such advice? Are these poults wiser than the hens? There was no argument brought up to justify this bad practice of direct instVar usage!
>
> More on: http://thesmalltalkblog.blogspot.com
>   



More information about the seaside mailing list