|(Smalltalk > you) ifTrue: [self postTo: LiveJournal].
||[Jan. 12th, 2007|12:53 am]
one dour badger
Been fiddling about with Dolphin Smalltalk. I'm really liking this language. I first figured objects out in Java, and they seemed like a great idea, but certain things just seemed more complex than they needed to be. Smalltalk has no such cruft. Most especially, writing a small class does not necessitate writing a header which is larger than the method code.|
It took a little bit of getting used to, but building live classes in a browser is immensely superior to writing them in an arbitrary editor. There is no compile cycle! Testing code in a workspace makes debugging an instantaneous process. I wondered at first if the live image methodology would hurt collaboration (because with a monolithic image instead of individual source files for your classes, CVS is essentially impossible), but now I see that Smalltalk classes are so... well, small, that the ability to trade packages around is plenty.
The degree to which you can re-use code is unbelievable, even on a small scale. Block closures are my all-time favorite structure. In every other language I've used, there has always come a time when I've wanted to insert arbitrary code into a routine at runtime. Silly me, I was just using the wrong languages! Thinking back now, I wonder if it was Logo that put the idea in my head; Logo is simplified Lisp, and Lisp does similar things.
And where closures let you make a lot of your code highly generic, the way class inheritance works (and the speed with which you can build new classes) lets you also hone general tools into very specific ones just because they're easier to reference later. Case in point, I was building a very generic PolyhedralDie class; once I was done, it took about a minute to subclass it into a FixedPolyhedral abstract singleton (mirroring instance methods to class methods and disabling the #new method), and then mere seconds to subclass that into concrete singletons D4, D6, D8, etc., which I can now utilize with direct class calls (D4 roll) instead of building an appropriate-sized PolyhedralDie (PolyhedralDie new sides: 4; roll).
It's bedtime, or I'd ramble more. This language is so... fun! :D