[squeak-dev] smalltalk evolution

Kamil Tomsik info at tomsik.cz
Wed Jun 1 11:13:08 UTC 2011


I'm not trolling, feel free to ignore me if you think so.

It's just common to not depend on internal state of other objects (even  
parameters),
if client will pass something wrong, it's his failure. Otherwise we would  
end up
with Java-like code, where everything is checked by instanceof and  
revalidated, just to be
sure.

and "Point new [x: 3, printOn: aStream]" could result in 3 at 0,
it's not a big deal.

And I've read all of those and few others too. Just to be clear.

Best,
Kamil

Dne Wed, 01 Jun 2011 12:18:27 +0200 Juan Vuletich <juan at jvuletich.org>  
napsal(a):

> Kamil Tomsik wrote:
>>
>>
>>> So, #new: creates a point without values for x and y... What if I want  
>>> to only build objects that make sense, meaning that their instance  
>>> variables must conform to some invariant defined by the class?
>>>
>>
>> you can't do this even in smalltalk.
>
> How come? In your Point example it is very easy to get a 'broken'  
> point... How would you get an equally broken OrderedCollection in  
> Smalltalk? In my opinion doing 'OrderedCollection basicNew' or  
> "anOrderedCollection instVarNamed: 'array' put: nil" don't count,  
> because it's not happening by accident: You're clearly stating the  
> intention to break it!
>
>> ...and checking arguments presence is not enough, you would need to
>> check its internal state too - and you shouldn't do that.
>
> You shouldn't do _what_? You say you shouldn't check internal state? I  
> wonder what you mean here... and if you're serious or just trolling...
>
> You'd be in a much better position to find Smalltalk's shortcomings if  
> you first learn more about it. Start with "Design principles behind  
> Smalltalk". "The early history of Smalltalk" is also a great read. There  
> are many great books about Smalltalk, for example "Smalltalk with  
> Style". Then, spend a couple of years doing relevant, non-trivial stuff  
> with Smalltalk, studying the image and applications written with it.  
> Maybe then you have a better POV.
>
> Cheers,
> Juan Vuletich
>
>>
>>
>>
>> Best,
>> Kamil
>
>


-- 
Tato zpráva byla vytvořena převratným poštovním klientem Opery:  
http://www.opera.com/mail/



More information about the Squeak-dev mailing list