Knowing When You’re Tired
By Adrian Sutton
There’s a big difference between code you write when you’re fresh and code you write when you’ve just had enough. I obviously had a relaxing weekend, because today my approach to coding was surprisingly well behaved – even when I had to modify legacy code that had no test coverage I made sure I wrote new tests before I touched it. Getting into TDD for new code is one thing, building up the discipline to add tests to existing code before making even a simple change is really tough.
Fortunately, if you know you’re getting lazy you can manage it either by paying more attention to the process and taking smaller steps or by doing something simpler that requires less concentration. The real danger is when you aren’t aware that you’re fading out and taking shortcuts – that’s where you really need a pair to step in and pull you up.