Here are a few things I do to boost my coding productivity. Everybody’s different so results may vary.
It’s All About Flow
Flow is my goal. All of these things are targeted at creating and maintaining flow. For me flow is best described as an intense focus to the point of being absorbed in the task at hand with little thought directed at how you are actually doing it.
Flow happens when I forget about the code and the language I’m coding in. I forget about the tools I’m using and what my fingers are doing and sometimes I even forget to eat. For me it’s very similar (and similarly gratifying) to the experience I get when I’m downhill skiing and I’ve practiced enough that I don’t have any issues with balance; It all clicks and feels right. I’m absorbed in where I want to go and the breathtaking views rather than what my legs, arms, and body are doing (or not doing) to get me there. It may also be similar to how an NHL hockey player is focused on watching the puck fly into the net, not what his left skate is doing, and the position of his hands on the stick. If you’ve never experienced flow, I may not have found an analogy that works for you, but trust me, being in the flow feels fantastic and is very productive.
Get Comfortable
When it comes to programming you have to be extremely comfortable with all of the practices, technologies, and tools you’re using. This may take years and years, but eventually with enough time and effort you will get there.
Even if you are completely comfortable with your tool-set there are other things that can get in the way of a good intense rip-it-up coding session:
Isolate Yourself
I typically need 3+ hours of total isolation to really get the flywheel up to maximum RPM. There might be certain tricks you can use to get into the flow even faster. High tempo electronic music with no lyrics (or repetitive lyrics) really works for me. After about an hour of isolation I’m pretty close to peak performance, but one interruption can set me back another hour. Once I get in the flow and am not distracted I can maintain it for 4-8 hours. Also, the longer I’ve been flowing the easier it is for me to continue in the flow after a short distraction.
Fine-Tune Your Tools
I set the computer up so I don’t have to interrupt the flow to get things done. Some things that interrupt my flow: hunting for things in the Start menu, looking for a file in a directory with a million files in it, waiting for a compile, waiting for key-strokes to appear on the screen, using the mouse rather than a short-cut-key.
I like my coding environment to be as seamless as an xbox game. If I’m playing Halo and I’m in the middle of killing 1,000 bad-guys (I know. 10 is a stretch for me, but hear me out.) and the game pauses to garbage collect, then Halo minimizes and a window pops up to let me know a virus scan has completed. I’m a bit frustrated, but I kill the pop-up and go back to Halo. I get back into the groove and realize I need to switch weapons, so I open a series of cascading menus, hunting for the work MS-Halo Weapons, by the time I find it and click on the weapon I want I’m dead. Arghhh. I’m not really having fun. For gaming an experience like this is unacceptable and I think it’s unacceptable for coding too.
Memorize & Create Short-cuts
If there is a short-cut key for something, memorize it and use it. Switching from just getting it done to hunting for something in a menu or a list is one of the biggest flow disruptors for me. I’m not sure this is universal, but many highly-productive people I know swear by shortcuts. It makes perfect sense to me. You’re cutting down the amount of work your brain has to do to go from “I want to do XYZ” to actually doing XYZ. It cuts out the hunting step completely.
Keep Tuning
You may find other things I haven’t mention that help you get into the flow, or disrupt your flow. Learn to notice these things and adjust what you’re doing to enable yourself to get into the flow and stay there more often. It will pay off more than you can imagine.
Productivity Tools
Here are some tools I use to help me be more productive:
Launchy - http://www.launchy.net/
Launchy is my replacement for the Start Menu. I almost never open the start menu just to browse around to see what kinds of things are in there. I always know exactly what I want to launch. Excel, Word, iTunes, Sql Server Management Studio, etc.
For example, I just hit CTRL+SPACE and type excel, hit enter and Excel pops up. It’s awesome.
SlickRun - http://www.bayden.com/SlickRun/
I use SlickRun to create magic words (shortcut words) to web sites and other tools.
For example, I just hit WINDOWS+Q and type jira - hit enter and Jira pops up in my browser on my Jira homepage. I have shortcuts for wiki, searching amazon, .NET class library, google reader, teamcity, opening my vm, opening cmd windows in various directories
Have any tips on achieving and maintaining flow or other tools you’d like to share?