When do you write your best code?

Writing software is a craft. Ask any developer you respect what they think, and the majority will say it’s more art than science. Take any ten good coders, and they’ll all work in different ways, create code that looks and feels different. Authors find their ‘voice’ after they’ve written a few books – I think … Continue reading “When do you write your best code?”

Writing software is a craft. Ask any developer you respect what they think, and the majority will say it’s more art than science. Take any ten good coders, and they’ll all work in different ways, create code that looks and feels different. Authors find their ‘voice’ after they’ve written a few books – I think coders do too.

I seem to write my best code in the wee hours of the morning. Maybe it’s the quiet and the solitude. Maybe it’s the fact that the only thing keeping me awake is the electron radiation I’m getting from the screen. Whatever it is, I seem to have had all my major breakthroughs around 3am.

This morning there was an electrical storm around 2:30am. The thunder woke me, and I got up to close the windows in the house, before louder claps might wake the kids. By the time I got back to bed, I was pretty certain I wouldn’t get back to sleep, and I didn’t. So, I got up and started reworking the code I’d written a few weeks ago, from a completely different angle. In four hours, I’d reproduced everything I’d done to date in a more elegant, more thoroughly tested fashion–I think I felt more refreshed getting in to the shower at 7am than I normally do when I get up in the morning.

I brought up the early morning code thing with a colleague at work. He spent two years writing a computer game in his spare time, and says all the coolest ideas he came up with were all after 2am. I don’t know anyone who says they write their best code in mid-afternoon 🙂

Leave a Reply