« Eclipse 3.0 versus IDEA 4.0 | Main | Interview with Code Generation Network »

Code Generation & Turing

I woke up early this morning with nothing in particular to do so I've just spent some time tidying up the JDBC code that FireStorm/DAO generates. When writing code generators it is quite easy to end up generating code that isn't as concise or elegant as human-authored code. Some would argue that this doesn't matter since no human is going to be maintaining the generated code anyway but I take pride in the fact that I could pass off the generated code as my own hand-written code.

This might also help remove many developer's prejudices against generated code if they can't tell whether it is generated code or not. In fact, in these days of outsourced development, we may need a new variation of the Turing test to detect if code is being generated or hand-written so we don't get overcharged. It would probably be quite easy to detect the difference unless we ask our code generators to introduce some random bugs! (I believe 20 bugs per 1,000 lines of code is the going rate when we code by hand).