Coffeehouse Post

Single Post Permalink

View Thread: Have you ever used code generation?
  • User profile image
    Michael Butler

    Over the years, I've used a lot of code generation. Whether it be self-built tools or things like T4 or other third party products. I used to use CodeDom but that was sometimes more work than I wanted to do.

    I use it because I'm the kind of programmer who doesn't enjoy doing all the typing. So if I have large table which needs to have data stored in it, i'll create the table and then auto generated the SQL Upsert script, the C# SQL access code and the POC.

    I find that lots of code I write usually follows some kind of pattern, and if it uses a pattern then you can usually figure out a way for the code to be generated for you.

    Of course, with things like Entity Framework then I don't need to use my own tools as much as EF do a lot of the boring stuff for me.

    The code generation I use is usually a one off and I don't expect the tool to be able to cope with my manual changes. They are just "wizards" to get the boring boiler plate out of the way so I can get the app up and running and get on with the real business logic.