For me it is completely shutting out every around me. Headphones on, music loud, and food and drinks on my desk so I don't need to get up which normally ends up with me getting distracted.
Having a suite of unit tests I can rely on. It helps me avoid the paralysis that occurs when I wonder "what else might have been touched by this code I changed?" I can give that ? a couple minutes thought, write whatever changes I need, and then run the suite to see whether I missed anything. That factor more than almost anything else helps me write code quickly.
- Knowing Emacs well to improve code editing speed
- Having unittests to validate my changes quickly
- Using screen or tmux to quickly switch between shells while maintaining a full screen for each...code, shell, unittests, Python shell, database shell
- Using Xmonad to quickly switch between Desktop workspaces while maintaining a full screen for each
- Avoiding the mouse as much as possible, even on the browser (Vimium extension)
- Using the ThinkPad nipple when I do have to use the mouse
- I don't use an external monitor at all. I find the constant neck motion to switch between them tiring and distracting. The combination of screen, Xmonad and Gnome notifications allows me the same application throughput with less distraction and without sacrificing screen space.
That's just off the top of my head. There's probably a lot more. Maybe I should write a blog post about it.
Only for my USB sound card when it is connected and disconnected. But, that's more of a nice-to-have. Everything else is built into the programs I use and into Gnome.
Motivation. If I'm motivated to get the work done, I will have razor focus. If the task is something someone else wants me to do (but I don't particularly want to do), then I won't be as motivated and it won't get done as fast.
Additionally, I don't like doing tedious things, so I always try to make whatever I'm doing as less tedious as possible. For instance, I'm supposed to get some feature working. The underlying code is very complex. Getting the feature working wil be very painful and tedious. If I can refactor the underlying codebase first, implementing the feature will be less tedious and more enjoyable. The problem is that sometimes my team mates don't want me refactoring code, so I'm forced to trudge through the complex code and it takes me a lot longer to do it that way.
- knowing _exactly_ what I want to achieve, no exceptions (this doesn't include the how part but only the what part)
- repeatedly playing the same music for hours, closing out every noise that makes me think about anything else but the task
- not engaging in any other activities on the computer I'm working on before I start working because I find myself going back to those activities from time to time which is a huge distraction
- last but not least a bottle of water or a cup of tea
2) Think a little bit before writing on what you will write. Thus I have better program with less need to rewrite.
3) Using a 13inch laptop. The small screen estate forces me to concentrate on what I am doing right now. No place for other editor windows or browsers or anything else, just my code and my work.
What does NOT make you faster:
1) Having a special mechanical/ergonomic/whatever keyboard.
2) Having multiple large screens with tons of windows open. This is most of the time distraction and not helpful. Avoid it.
I have 6 24" FHD monitors. Although not all are in constant use, I find it useful to not have to drag windows around to check different thing (mail, skype, IDEs, etc..).
On the contrary, for me complete silence, dead-minimal desk and a piece of paper and a pen seem to work much better. I take programming as a serious task, I need to be 100% focused.
its old Simpsons episodes for me. Ones I have seen so many times I could quote every scene, if I have something on in the background that I don't know as well I'll be very distracted