Code generation is a ROUS?
Saw “code generation and datasets are rous’s” on Twitter tonight and it got me thinking.
I look at T4 templates and code generation as a big part of the future of .NET. EF uses code generation, Asp.net MVC generation, and Microsoft is supposedly bumping up their support for it in Visual Studio 2010.

Code generation is also gaining some traction as a performance solving alternative to using expression trees to produce more strongly typed development experiences.
Expression Trees aren’t the fastest things on the planet and throwing huge nested sets of nodes in your web application is probably going to muck things up.
Right now the .NET blogosphere I browse is absolutely full of expressions and I’m slowly adding things to my toolbox that use them. If it can’t be configured with a lambda I just don’t want to see it.
I’m predicting that either we get some compiler or runtime optimizations in the next version of C# 4.0 or everything we write up is going to be a little bloated with expression tree parsing. One possible solution we have is using T4 generation to get the strongly typed code we want without the extra overhead. Once writing up a T4 template to inspect our types and provide fluenty extension methods gets a little easier I’m sure it will be the new way to build the strongly typed options and configurations we need.
ROUS? Not really. Although I do admit code generation seems a bit like resurrecting ancient technology. Heck, Php just implemented GoTo so it can’t be that bad.

