Code Generation Should be the Nuclear Option
posted by jwstott(0) 3 years ago 0
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.
Reply
The Most Powerful Development Tool Ever Made
posted by jwstott(0) 2 years, 11 months ago 0
:( Use google - wow. Can I have my 1.5 minutes back please. Wait ... I know, what about.....MSDN documentation? Ohhhhh, now there's a suggestion for the next article I can see it now. What a tool.
Life After Loops
Nice. Might also mention to take a look at 101 LINQ Samples for even more things you can do with LINQ http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx