CodeGenIsBad

September 23, 2008
Is it? This guy thinks so:
... the technical debt you incur by implementing a certain feature in the quick-n-dirty way instead of doing it properly from the start is in most cases small and easy to pay back if you don’t put it off too long (obviously, it’s best to simply avoid having to incur any technical debt in the first place). Generating an incredibly large library of code, and then using that code all over the place has an impact that you simply can not recover from when the project has been in development for a long time.
I, like many commenters, felt the author was misdirecting his venom from his real world case - that the problem wasn't the fact the code was generated, but that the generated code was crappy and tightly coupled with the rest of the code base.

On twitter, Michael Feathers linked to the article and Uncle Bob had this and this to say about the matter:
I'll generate FSMs but little else. I really don't like GUI generators or DB access generators. Seen too many disasters.

rule 1. Don't generate code that you call or inherit from. Generate code that calls or inherits from you.

(and if that's not a sound business case for un-filtering Twitter at work, I dunno what is)

tags: ComputersAndTechnology