Code Generation
There are, in many applications, plenty of features that are trivial to implement but must be done over and over. Perhaps it's taking an array of model objects and preparing a list view, creating classes from database schemata, or creating a list of compile-time constants from a text file.
These situations can usually be automated by generating code. The idea is to express the problem in a succinct representation, then translate that into something that can be incorporated into your program. This is pretty much what a compiler does; though many programming languages are far from succinct, they're still much less unwieldy than the machine's native instruction code.
Writing Your Own Generator Shouldn't Be A First Resort
Just as a code generator makes it easier to create a product, it makes it harder to debug. For a concrete example, consider the autotools build system discussed earlier in this chapter. Imagine that a developer is looking into a reported problem...