Paul Graham's essay on distraction struck a chord with me. Basically he talks about how easy it is to get distracted and some techniques for staying focused. My favorite quote is:
If you drink too much, you can solve that problem by stopping entirely. But you can't solve the problem of overeating by stopping eating.For me, the Internet is a lot like food. I can't just give it up. It's integral to who I am and the kinds of things I like to work on. However, it's full of distracting treats and time wasters. Paul solves this problem by using a dedicated computer for all his email and web browsing. All his real work is done on another computer, that he keeps offline.
For me, I turn off all email alerts (Growl is not your friend) and shut down my email client when I'm trying to get some work done. Of course this doesn't help stem my tangential web browsing and whim following.
Of late I've started trying to group tasks together and focus on only those tasks for set amounts of time. If I can dedicate an hour or two to just the tasks related to a specific project, then I can make some real headway. Part of the key is just focusing on tasks related to that specific project and nothing else. Having a specific duration in mind can be a big help. By getting yourself to focus on one project for an hour (or even 10 minutes) will help you get into the flow of things. And for me, the flow around accomplishing tasks is really the best reward.