CodeSmith is a code generation tool. You create templates that specify the code to generate, and add properties (such as class name, namespace, etc.) to the template to further customize the output. It gets even better – you can even use most the functionality of the .NET base class library as well. For ASP.NET developers, the template syntax is apparently very similar to this, so it shouldn’t be hard to pick up at all (I don’t know ASP.NET, and I didn’t have any problems). The CodeSmith UI is also very similar to Visual Studio, as well.
While CodeSmith is freeware, there is a professional version. The only differences between the two versions that I could find are that you can’t edit templates in the free version (they’re just text files, so this is no big deal), and with the professional version you have the ability to integrate the CodeSmith engine into your own applications.
In about ten minutes, I was able to generate a template that will create a strongly-typed collection. Since every single collection that I create has exactly the same code in it (aside from the type of the object being stored), this is a huge timesaver. It boggles the mind to think about what exactly can be done with this tool.
The only downside of CodeSmith is that isn’t integrated into Visual Studio. That’s not a very big deal though, I’m more than willing to put with that.
Via Duncan Mackenzie.