What percentage of your daily working hours do you think you actually work?
I sometimes ask executives who pride themselves on their memory to put down their guess as to how they spend their own time. Then I lock these guesses away for a few weeks or months. In the meantime, the executives run an actual time record on themselves. There is never much resemblance between the way these men thought they used their time and their actual records.
I can confirm from experience that this is as true for programmers as it was for Drucker's executives. We spend a lot lesser time in productive work than what we imagine we do. Sometimes we manage to get good work done only for half the time we think we did. If you aren't tracking your time yet, try it and see whether this holds.
A few months back I started weighing myself once every day. I didn't hit a gym nor did I enter a diet plan, I did nothing apart from being conscious of my weight on a daily basis. But over time I dropped a few kilograms and it has remained there since.
Measuring and tracking a metric - be it our weight, our expenses, or in this case how we spend time, is the first step to optimizing it. And often, just measuring alone can do the trick.
The Pomodoro technique is famous among programmers as an effective way to keep ourselves fresh and productive. It divides your day into intervals of 25-minute work followed by a 5-minute break. The crux of Pomodoro however is not the specific time intervals you choose, nor that you take a break often, but the fact that a timer is running when you work. A timer focuses you like nothing else can. A quick look at the email or a peek at your Twitter feed are out of question while you are timing yourself. Simple but pretty effective.