Take a Break
I left work an hour early today.
I'd been working hard on a new feature. It was all going well until I hit a wall. Progressed stopped. I hacked away for half an hour. I ruined my nice design and still failed to get things working. I reverted my changes and tried a different approach and still didn't get it to work.
So I left.
I reverted my changes again, got on my motorbike and went home. It was a nice ride. Dry roads, warm air, not too sunny. I forgot about my work as I filtered through the traffic. I pulled up to my house with a grin on my face.
And then it hit me. My program's design was wrong but only a little bit. One method in one interface needed one more parameter. I can quickly add an overloaded method to the interface tomorrow, provide a default implementation so nothing breaks, and deprecate the old method so I can gradually remove calls to it from the code.
Sometimes you just need to step away from the keyboard. I'd still be making a mess right now if I had stayed at work. Instead, I've solved the problem, written a blog post and feel a lot more content than I would otherwise.
Addendum: I've just realised that this blog might not frame my work ethics in the best light. My hours are flexible and I start an hour early every day. I work best in the morning so this suits me. It also means if my brain is ever fried or I have something on in the evening I can leave a little early.
08 September 2014