I saw a few "Ruby vs. Smalltalk" comparisons over at LtU:
Ruby has mixins; Smalltalk does not. Mixins help much in design.
Ruby permits adding methods to individual objects; in Smalltalk, all methods reside in classes.
In Ruby, it is practical and somewhat useful to add methods dynamically; in Smalltalk, the practice is generally to treat the methods and classes as static.
Ruby offers powerful macros in class definitions; Smalltalk offers no macros at all.
Well, yes and no. Mixins are not part of Smalltalk, nor are macros - but you can add methods to individual objects. It's not commonly done, but it's pretty straightforward - grab the method dictionary of an object and plow away. I have no idea where the author gets the idea that Smalltalkers generally treat classes and methods as static; that's simply not part of the Smalltalk culture at all. As to loose methods - while blocks aren't exactly that, they sure are close - and if you look at the way the Smalltalk workspace works (which is also how the Cincom Smalltalk SSP implementation works), it's pretty easy to take loose methods and compile them on the fly.
A lot of the test of the post talks about the convenient syntax of Ruby for this, that , and the other thing - however, I think it's a positive benefit that Smalltalk has a minimal syntax, and does everything in the library. It makes it a lot easier to ramp up, IMHO, and makes for a more powerful language.
Technorati Tags:
smalltalk, ruby