Leave the desk
When I need time to think, I get up and go for a walk. It is good for my brain and back to have a change of scene and posture.
Don't thrash
If I've made a couple of attempts to solve a problem, and it seems like a good idea to “just try†another, then it's time revert the code and think. If I understand the program, and have a good test suite, then it could be correct. With only one of those conditions, it won't be. Unfortunately the temptation to “just try†something mainly strikes me during sysadmin work, when there's no code repository to save me from myself.
Finish work
I've had to accept that I may wake up at 3am with the solution to a problem. But I plan not to take problems home. After I've understood the essence of a problem, and converted that understanding into code, if it's within sight of stopping time, I don't run the test case. Instead I get out while the getting is good.
Learn
I do read at home, background reading rather than manuals, something that will broaden my knowledge. Deepening it is for work time, maybe for that half hour between the last coding of the day and leaving time.
Thanks
When someone reports out a defect in my code, the first thing I say is “thank youâ€. Over time, this response has become sincere.
Be comfortable with error
Many times a day, I test code I have written and find out that it is defective. If I took this to heart, I would begin to feel that I was defective too. I have needed to acknowledge lightly that there are opportunities for improvement in my work.
Argue only about issues that make a difference
“What I meant was ...†usually introduces a point that matters to no one but me. What we should have done last year will remain unimportant until the invention of a time machine. The only question that ever really matters is “What shall we do next?â€.
Reflect
Making mistakes is fine, repeating them less so. There's always a deeper level to go to: “What question could I have asked, that would have prevented me from making that mistake?â€
People first
A hour thinking and talking about a damaged working relationship can achieve more than a week's coding.
Has anyone else got some other techniques of this sort?