Does this look familiar to you?:If so, there's no way you can get into flow during work hours. You either don't get into flow (bad), or work evenings and weekends to get anything done (also bad).
Fortunately, there is a simple, free, and ridiculously effective solution to this problem.
Working with management, institute two no-interruptions days per week.
Stagger the two days to avoid being out of contact with others for two days in a row. (I recommend Tuesday and Thursday, but Tuesday and Friday also work well.)
Make the two days sacrosanct.
Have everyone on your team reserve the two days on their calendars:Make your calendars public so everyone can clearly see the two days blocked out.
Politely decline all meeting invites on the two days, with the explanation that the two days are for focused work, and suggest scheduling the meeting on one of the three non-focus days that can be wasted playing office.
And also be firm with yourself. The two days are not for running personal errands, goofing off, etc. The two days are for focused working. If you screw this up, management will consider the experiment a failure, you'll lose credibility, and it will be hard to convince them to remove other, more difficult obstacles.
On the two days, shut off IM, Twitter, RSS, your cellphone, etc. It will be hard to do that at first. You'll feel cut off, out of the loop, going through withdrawal.
Good. That means it's working.
Ideally, assuming you have a good home-office work environment, work at home on the two days. That way you can roll out of bed, grab something quick to eat, and start coding.
Be sure to put in a full eight hours of focused time on each of the two days. (You will find this easy to do, because you'll be in flow.)
Congratulations, you just worked your 16 hours/week! You are 33% more efficient than the industry average. If you manage to work a few more hours on the other three days of the week, that's all upside.
Some people can get really offended that you declined their super-important meeting. Boo hoo. This is when it's vital to have management backing, so you can send the invitee to management for goal alignment. You need management to make it clear that interrupting a programmer on a no-interruptions day is stealing from the company.
Because you will actually be able to clock 16+ hours a week with this system, management will give you the backing you need.
You also need management backing if you work across teams, so that the no-interruptions days can be aligned. (It does no good to declare Tuesday as a no-interruptions day if a team you have to work with picks a different day.)
If you can't get management backing for this and/or if upper management is for it but your own manager is against it, change jobs. Seriously.
How dogmatic should you be about no interruptions on those days? Well, there's sort of an art to getting it correct. Obviously if you are blocked because you have to ask somebody else a question, it would be nice to be able to get an answer right away. But it's a slippery slope. You have to be careful to only interrupt when it's really important. And you should never, ever, accept an invite for a recurring meeting on a no-interruptions day.
The irony of this system is that it costs the company nothing to implement. Mostly it just involves changing the days for some meetings. A simple, mechanical process.