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