If you are new to code generation (even if you are not!) you need to get a copy of CodeSmith 2.6.  This app is the cats meow when it comes to templated code generation.  Eric Smith has really out done himself (is it really just one guy??).  Here are the features he listed in his release email:

- Syntax highlighting of both template and target languages.
- Much improved Visual Studio .NET custom tool.
- Outlining support.
- Line modification markers.
- CodeSmith Studio is now a single instance application.
- Improved compiler and template execution performance.
- Better Unicode support.
- Tons of other minor improvements and bug fixes.

He left out many more, but my favorite has got to be the “Template Code Expansion”.  Imagine an ASP 3.0 page with code and HTML intermingled.  Press Ctrl+Shift+M and watch the code collapse into hidden regions just like ASP.Net.  Very cool, and CodeSmith supports code behind as well.  As matter of fact, CodeSmith allows you take advantage of the full .NET framework to help you generate _YOUR_ code. 

Think about what ASP.Net has done for generating HTML?  Sure you could write that HTML by hand, but it really gets powerful when you can generate an HTML table row for each row in a table.  CodeSmith brings this same paradigm to code generation.

Nothing is cooler than code that writes code, and CodeSmith is the king of code generation.  Watch out for tips on how I use CodeSmith to help me get my projects done…