Code Generation has one tremendous problem.
We dont like the way the code looks.
and it does not change the formatting when you don't like the way it was generated or you have to fiddle with codegen settings (which every tool would be different). There are other reasons of course why codegen is not 100% accepted, like you cannot edit the generated code, else it would be overwritten by the next codegen, but this is already being addressed but partial classes in .NET, so there is still no answer for the formatting problem.
Introducing JIT Code Formatting
Just in time code formatting is the process of changing the formatting of any code to the way you want it.
Imagine I send you a small project, you open it and find I have prefixed all fields with an underscore. Your development tool, understanding this as a problem, changes the variable prefix for you when you open it. It lays out the code the way you like it. and likewise, when I open it, its changes the way I like it.
Checking the source into Source Control is not a problem, as it would convert it to a consistent format for before checking in.
For example: In Visual Studio, you would have settings for how you want your formatting. The formatting can be set and pushed to all developers and each developer can have the formatting the way they need and like it. The JIT-CodeGen engine then translates the code for your settings.
Now who wants to write this?
CodeGen in Visual Studio
The T4 templates are an example of a powerful feature in Visual Studio, incorporating code generation, however it will generate the code based on the developers ideas, conventions and standards. This is one of the problems of codegen adoption. However T4 from Visual Studio is still very cool. Read a little intro by Rob and from Scott