From: www.itworld.com

Code Generators Done Right

by David Wall

July 9, 2002 —

 

Sometimes, the easiest way to win is not to play, or at least not to
hard code. Or not do the hard parts of coding. Or something like that.
Hey, I write technical columns for a reason.

Anyway, plenty of Web application development environments have tried to
put happy faces on JavaScript. Code generators -- call them what you
like, but they're code generators -- usually allow you to do your design
work in a graphical interface that looks something like Microsoft Word
or another document generation utility. They're good to an extent, but
the text editors invariably come out at some point during the
development process. Some of us do *everything* in a text editor,
thereby cutting straight to the chase.

Code generators that admit what they are and don't try to conceal their
true purpose are the best kind. A code generator, JavaScript or
otherwise, should announce the kind of code it's going to put out, then
guide you through the options you can build into that code. The menu
builder utility on javascript.internet.com is a perfect example. It
generates a code module that causes your browser to render a menu,
complete with a series of headers, options, and linked commands. You put
in the labels you want, specify the links for each, and give some advice
about style and behavior. Then you turn the utility loose, and you get a
stretch of JavaScript to paste into your pages.

It'll work well with your text editor!