From: Jeff Date: 2006-12-29T10:55:11+09:00 Subject: Re: Paper on strong Object Oriented Encapsulation (Was: some subject with needless insults) Eric Hodel wrote: > After skimming for the Ruby keyword this paper has nothing wrong. I > can't evaluate the Smalltalk or Python claims, but they look accurate > from my understanding of the two. I agree. And I also agree with James, that the OP's choice of vocabulary was, shall we say, unfortunate. :-) However, if I could change the discussion a little bit, I wonder *why* encapsulation from subclasses is so important. Ruby provides decent protection from client code - usually a prudent use of attr_reader helps protect instance variables, for example, and I think I read recently in a future version of Ruby (2.0?) the use of :send to get at private methods/attributes won't be possible anymore either. But, the paper focuses (I admit after just a quick scan) only on the lack of encapsulation an object can exert against subclasses. That's always been a part of my belief system, too, as I grew up on C++ and later C#... but now I dare wonder aloud, has that really been all that important? For example, I used to think static typing was the only way to go, until I discovered unit tests as a way to stop worrying about my program's correctness. So now I wonder if this worry about protection from subclasses is even worth worrying about. Maybe the paper's authors are correct, Python and Ruby don't do this kind of encapsulation - but maybe the answer is evident by the increasing populariy of dynamic languages like Python and Ruby that you can write great software without needing it such protection anyway? As I write this, I'm thinking that as soon as I send this message, I'm going to think of a couple of great examples that will go against this idea, and then I'll slap my forehead silly but none of you will hear it... Jeff