Thursday May 5th

Wednesday May 4th

Tuesday May 3rd

Monday May 2nd

Code Generation Should be the Nuclear Option

So let me first just start off by saying: I do not like code generation. In certain cases I think it can help greatly, but many people are far too eager to jump to this solution. I don't think that there is anything particularly evil about the process of generating code, but I do feel like using code generation as a day to day tool is a very bad practice. Code generation should be the tool of last resort when there is no good way to cleanly implement a solution which doesn't require code to be spread out everywhere.


Yet another inflammatory rant without any solid examples to foster a productive discussion. Please stop voting for content that is not well thought out and thorough. It is a waste of our time to read rants.

Depends on what side of the fence you are on. I happen to agree with him, so I would like more people to read this.

I don't think it matters what side of the fence you're on - generation has its place and like anything, can be abused & misused. I'd get the fact the author doesn't like code generation - ok - but to say that generation should be a tool of last resort I is foolish. Just because you can (code generate) ...doesn't mean you should, might be a better statement. I can generate bad code en mass, or I can write bad code as I go. Is there any difference - it's all still bad code.

A great place to use code gen is where you have repetitive chores - say a DAL layer. Why wouldn't you code gen from a database to create your business objects? Is that evil, I don't think so. I disagree completely with the authors first issue - Maintenance and that code gen can be a maintenance nightmare. Are you kidding me - "you have created that much more code that you now have to maintain"? I think its the exact opposite. All I have to maintain is a template - when I want a change - fix it - then generate, done. Again, just because someone has used or implemented code generation badly - does that make code generation bad? I wrote a bad web app - so the internet must be flawed and can't be used? Don't think so.

Flexibility - if you don't have access to a template that you do need to modify - was the template/generation engine the right tool for you? Don't blame the tool or technology because you need something it can't give. Just because you have a hammer - everything doesn't become a nail.

This guy is so good he codes in 1's and 0's

why on earth would you not auto generate DAL code? Its almost as if the author has never actually seen a code generator.

Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network