Friday 8 February 2013

If in Doubt, Write It Out

One can borrow this adage from mathematical problem solving, to solving difficult programming tasks.

Sometimes a task is difficult not because it is intellectually difficult per se, but due to the fact that it requires tracking of very precise details e.g. when writing code to transform one peculiar date format to another data format. In this case, the visualisation of the data may be different, but also be semantically different e.g. if going from a super-precise representation (say, one which captures picoseconds) to one which has lower information content (e.g. rounding to nearest second).

In this case, explicitly writing out the various layers of the problem in a Word document may be your best bet to programming an accurate solution quickly and effectively.

Note: pico = 10^-12 (next notch up from nano = 10^-9).

No comments: