Code-Generation Techniques for Java
Subject:   Code smell
Date:   2003-09-08 10:47:29
From:   anonymous2
Response to: Code smell

Funny you should say that. Arguably one of the most expressive languages around, Common Lisp, relies heavily on code generators (compile time macros).

I love code generators, macros, "wizards", etc. They let me express my applications requirements in a way much closer to their domain than what the assorted languages provide. I've been working with them for over 15 years.

Plus, while many languages truly aren't very expressive for a particular domain, they are quite dominant. A code generator can enhance a lesser environment in a specific way allowing you to leverage both the community and legacy code already in the other language along with the expressability of the language for the code generator in the specific vertical you are dealing with.

Code generators help leverage existing environments so that you don't have to give up higher level abstractions or throw out the baby with the bathwater by migrating to a more expressive system.

The hard part is finding a good code generator that allows you not only create the code, but also recreate the code. That's the sign of a better environment as most systems are a one shot deal that don't adapt to change very well.