The pragmatic programmer is really keen on code generators. Which is the right thing to do. It's also very difficult to do in practice as the languages that are sufficiently impoverished to need external code generators are invariably bound to build tools that can't sanely deal with them.
edit: oh, and also it's hard to avoid people checking in and/or editing the generated code
edit: oh, and also it's hard to avoid people checking in and/or editing the generated code