Code Generation Should be the Nuclear Option(codethinked.com)

submitted by justin_etheredgejustin_etheredge(8539) 3 years ago

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.

5 comments |category: |Views: 322

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by offwhiteoffwhite(975) 3 years ago 0

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.

Reply

posted by brianjlowrybrianjlowry(640) 3 years ago 0

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.

Reply

posted by jwstottjwstott(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

posted by vidalsasoonvidalsasoon(0) 3 years ago 0

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

Reply

posted by xdavidxxdavidx(0) 3 years ago 0

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

Reply

information Login or create an account to comment on this story