Below is a widely circulated image on the internet about programmer work efficiency:

Homer Simpson might say: This is funny because it's true.
I haven't figured out the secret to staying productive, mainly because I've never been consistently productive. Joel Spolsky once said in one of his blog posts:
Sometimes I can't get anything done.
Of course, I walk into the office, wander around, check email every ten seconds, browse the web, and even do mindless things like paying the American Express bill. But I just can't get back into the flow of writing code.
When such a bout of inefficiency hits, it usually lasts a day or two. But in my career as a programmer, there have been several times when I couldn't get anything done for weeks on end. As they say, I was absent-minded, I was in poor form, I was completely out of it.
I've read this article five or six times, and I'm still deeply shaken, because such an iconic figure in the programming world can also have such rookie problems.
Fortunately, I'm not the only one with this problem.
I don't have any secrets for staying productive to share here, but I can tell you what makes me unproductive:
- Open-plan office layout
- Programmers arguing about which is better, Django or .NET
- Programmers arguing in general
- A colleague comes over and asks: "Hey, did you get my email?"
- The sound of chewing. Apparently I have misophonia.
- Not understanding the problem I'm working on
- Doubting this project
- Having multiple tasks to complete, all of them extremely urgent
- When something is extremely urgent, nothing else gets done
- Weibo notification sounds on my phone
- Email notification pop-ups
- Any pop-up windows
- Instant messaging software
- My wife asks: "Hey, can you spare a minute to help me with something?"
- Long build times
- Noise
- People constantly walking past my desk
- Company group activities
- Wikipedia (I'm serious, don't click any links)
- Hacker News
- Overall, the internet affects productivity
These things used to make me work efficiently:
- Quiet environment
- Quiet office (private offices are too rare)
- Understanding what I should do next in the project
- Having a thorough understanding of the problem
- No interruptions
- I'm serious: no interruptions
- Staying away from Weibo
- Staying away from Hacker News
- Hardware working without issues
- Loving the project I'm working on
- Build and debug times are not long
- Don't argue about politics online
Obviously, half of the inefficiency factors are self-inflicted, but some are not, such as the open-plan office layout.
Fundamentally, each of us can control the factors that make us unproductive. I won't engage in passive confrontation. I either take a firm stance or sit there letting others walk around me. I'm really not good at dealing with this. So, I don't have good advice for handling external inefficiency factors, but I know this one thing: control what I can control. Meaning:
- Turn off notifications on my iPhone (a bonus is increased battery standby time)
- After coding for 3 consecutive hours, give myself a reward (usually in the form of "internet time," browsing Hacker News or Weibo)
- Only work from home when there's really, really something that needs to be done
- Invest in a cost-effective noise-canceling headphone
- Schedule "meeting-free" time on the calendar, showing others that you're busy during these times. This is my work time.
- Don't get involved in office programmer arguments; people have strong personal opinions, and programmers are characteristically argumentative. If there's really a business problem to solve, let's go to the meeting room and lay out the pros and cons of each approach. Let data speak, don't just argue.
- Place your desk somewhere where you won't be disturbed by passersby.
- Read through the problem first, then ask another programmer to explain it to me in detail, so I can have a better understanding of the work to be done. This achieves two things: First, it allows me to grasp the situation, giving me at least a basic understanding of the key points of the work. Second, it allows me to ask smarter questions when seeking help.
Original article link: George Stocker
Translation link: http://blog.jobbole.com/73383/