Dave Thomas <Dave / pragprog.com> wrote: > So, I'm guessing that this could well be another of those cat > people/dog people kind of things. Some folks would rather have great > tools and will sacrifice some language power, while others will > sacrifice the tools for a language which is more expressive. It's dangerous to say things like "a language which is more expressive". There's nothing that would stop you from writing Smalltalk with a Ruby accent, and use identical code generation techniques. Early in learning Smalltalk, I did exactly this; in fact, I wrote a very nice framework to support it. It was called MetaMonkey (http://minnow.cc.gatech.edu/squeak/metamonkey), and let you add code-generating class methods modelled after :attr_accessor. Being in Smalltalk, I made sure it was nicely integrated with the environment - the second you changed any of these code generators, or added new calls to them, the browser would immediately update with the newly generated code (in a special category so you could ignore it if you wanted - this also made it easy to automatically clear and regenerate everything at once). Culturally, however, this didn't fly. It's not like I got any lectures on the evils of code generation, people just didn't use it. There were always more elegant solutions to the problem. I posted an example showing how to use MetaMonkey to simulate Ruby-style mixins, but someone else posted code that added them for real. As a library. Without changing the VM. As I got better at implementing these more dynamic, more elegant solutions myself, I stopped using MetaMonkey too. I also stopped building specialized Compiler subclasses for use by my code, another good way to confuse the tools. Technically, nothing was stopping me - on a class by class basis, I could have made the choice to lose some tool support and cultural compatibility, in return for the particular sort of expressiveness that code generation gives, and yet I consistently (these days) choose the Smalltalk Way. So, yes, it's a dog people/cat people thing. But it's a complex cultural issue, not a simple technical one. Which, to me, makes it all the more fascinating. To me, the central paradox (and power) of Smalltalk is that it: a) technically encouranges you to change the language in any way you want, at whichever level you want (see my note about subclassing Compiler). b) culturally encourages you not to, 999 times out of 1000. Of course, that thousandth time is crucial - like when I needed to add callcc. But it didn't require generating any code to do so. Cheers, Avi