Andres Aguiar: "ASP.NET is a code generator". I guess.

[Marcie Robillard]


In my opinion, ASP.NET is absolutely a code generator. We could be forced to write an IHttpHandler with thousands of Response.Write statements to output our HTML for every page we want to create, but someone decided that there is a more efficient way to write this code and created a level of abstraction to do it (ASP.NET). ASP.NET is not a language that the .NET runtime understands. It is a template-based code generation syntax that generates code .NET does understand (C#/VB.NET/JScript/etc). I believe that ASP.NET style syntax happens to be a perfect fit for template-based code generation and that's why I mimic it as closely as possible in CodeSmith. To me, code generation is all about solving problems from a higher level of abstraction. Code generation is given a bad name by magic button applications that generate a bunch of code or even an entire application that the user has no control over. I personally can't stand this type of code generation. They tend to produce code that people treat as a black box and, more importantly, they take away the creative part of being a programmer. CodeSmith rewards a developer for being creative by saving them from writing the same repetative code over and over and over. You might say that refactoring will do the same thing, but I believe that template-based code generation compliments refactoring. There is only so much refactoring you can do and no level of refactoring can magically write domain specific code for you.

2 Comments

  • Yup, yup, you're absolutely right. I just freeze when I hear talk like this because I've spent the last couple of months trying to convince some people that ASP.NET isn't "some stupid code generator". :(





    Can't wait to check out CodeSmith!


    Marcie

  • The reason why code generation has a 'bad' name is because of the Elitists who think they are better than the rest and declare the usage of a code generator a sign of weakness and a signal that the user of the code generator is not up the par with the Elitists when it comes to die-hard coding because the code generator user needs a generator.





    I really am getting sick and tired of all those Elitists who think developing software is done inside a text editor.

Comments have been disabled for this content.