Friday, 19 March 2010

Small is...useful

Micro-post today:

I'm an active member of a couple of places where people post questions and (hopefully) get answers to them. Time and time again I see questions like "I'm doing X, but it isn't working. Why not?" followed by 35-200 lines of code, of which the eponymous "X" is 5-10 lines of code.

People. Seriously. It's like you've never heard the maxim of the Old French Republic: divide et impera (in English, loosely: divide and conquer). Or to put it in even geekier terms: Create a minimum failing test case. There are two very good reasons for doing this:

  1. I give it 90% or better odds that if you build a minimum failing test case, you'll figure out why "X" isn't working.
  2. If (1) above doesn't work out for you, well, then you have this lovely minimum failing test case you can post so people can help you out.
See? Vincere-vincere!

No comments: