The Downside of Clever

December 8th, 2007

At todays BarCamp, Derek gave a great preso about [Test|Behavior] Driven Development. The talk included comments and observations on how to ensure that your code is not only correct, but maintainable. He mentioned flog, a Ruby tool that analyzes your code, applies some heuristics, and reports on how baroque and troublesome your code may be.

A high flog score typically means that someone has been too clever for anyone’s good, and it brought to mind a quote from Brian Kernighan (which I first heard about from David Koontz):

Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it?

2 Responses to “The Downside of Clever”

  1. Brian Says:

    Hey James, thanks for remembering to post this. It’s a great quote!

  2. raggi Says:

    I’ve been noticing that heckle-able code (at reasonable complexity) seems to come in with methods that generally score under 12. Whilst not a fixed rule, I’m interested to know what others experiences are?

Sorry, comments are closed for this article.