Posts Tagged ‘sloppyness’

Debug at the thought level

Wednesday, July 23rd, 2008

Have you evener wondered why so much code gets refactored again and again? Why there are several specialists living on this topic? If refactoring is about improving code, one could assume that’s quite a good thing.

Ever wondered why there is such a thing like refactoring? People seem to like implementing quickly and refactor afterwards. Ever wondered if we could do this in a single step? Or at least hack the stuff just one time?

The programmers I got in touch with hardly write something down before they implement. I also often feel like hacking when I first see the solution of a problem. But that’s the first step of getting yourself into trouble.

What we could do is write before we code. Write the solution. Not just the outline, the comfy part, write down the complex structure of the whole solution.

Writing things down shows you how sloppy your thinking is” says Leslie Lamport advertising the model-checking enabled TLA+, which is mainly designed for developing algorithms. I’d strongly agree but drag that idea to a more generic level:

Debug at the thought level! For every implementation, for every two classes you inherit, for every step you want to take in you career, for everything you feel too sure about. Write it down. See the output of you brain manifest and watch yourself thinking over it one more time.
If it’s not the IDE you commited your initial sloppyness to, you probably save a lot of time!