__matthewHawthorne wrote:
> There are many times that I've wished I had found a nice way to
> autogenerate things while creating a bunch of redundant primitive
> methods.
There are half a zillion methods for generating code, starting
with Bash/Sed/Perl hacks, leading to dedicated macro languages
like the C preprocessor and m4, continuing with a variety of web
templating languages like PHP, there's XSLT and finally high
level stuff like lex/yacc, ANTLR and all the other grammar
generators.
The recurrent problems:
- Need dedicated Ant tasks (Make was a bit easier here)
- IDEs rarely handle them well
- Tracking compile and runtime errors caused by generated code
to the ultimate source isn't well supported and often painful
I personally use ad-hoc generators mainly to bootstrap code, once
the bulk of the code is stable, I abandon them.
J.Pietschmann
|