Willpower is a muscle, which uses the same resource as brain tasks (programming, arguing)[1] - let's call it "cognitive energy".
1) don't waste cognitive energy on silly tasks (games, arguing in comment threads, etc.)
2) practice exercising willpower - it's a muscle, you can train it to be better. Start by forcing yourself to complete a routine every morning (the trick with habit forming is to not give up after you miss a day.) examples of habits to form below.
3) look into mindfullness meditation[2] - this can help you identify distracting thoughts as they arrive and practice ignoring them.
Meditating is a good habit to form as practice, and it will also help you get better at habits. You could also exercise on a schedule (and record when you do, including how heavy you lifted/how fast you were running). Eventually, with a stronger willpower-muscle, you'll be able to choose the fruit salad over the cake, even when you've just spent your 7.5 hours a day coding.
I've not found pomodoro to work for me as an easily-distracted person, it's better when you're prioritising work tasks (e.g. 25 code vs 5 email) and even then, 25 mins is too short for good programming "flow".
This is a hard problem, everyone has trouble with it. Good luck!
I came here to add that research that Kathy Sierra referred to in her article on willpower and cognitive processing capacity... but you beat me to it :-)
Another interesting article on willpower is by the APA on http://www.apa.org/helpcenter/willpower.aspx, refering to actual experiments instead of common opinions. Interesting quotes from that:
> At its essence, willpower is the ability to resist short-term temptations in order to meet long-term goals.
> Self-discipline, the researchers found, was more important than IQ in predicting academic success.
> The benefits of willpower seem to extend well beyond the college years.
There's a nice (short) book on techniques to stop/handle procrastination: Eat That Frog, http://www.amazon.com/Eat-That-Frog-Great-Procrastinating/dp.... One of the ideas is that if you start with the hardest task, everything else will be easier after that.
Just want to second the mindfulness meditation suggestion. On it's face, it sounds like new age nonsense, but it's really a mental discipline where you practice keeping your attention in the present. Not thinking about anything is very difficult to do:
I also recommend adopting an exercise routine in the morning. I find myself much more productive and focuse during the day if I've gone for a 5k run first thing when I wake up.
Also, consider installing parental monitoring software on your computer. I use the Nanny for Google Chrome plugin to block access to news and other time-wasting sites during the day or limit myself to 10-20 minutes of such sites a day. It's easy to get around (I turned it off to post this comment), but it serves as a reminder to stay focused:
Third for meditation practice. On a subtle level, the mind when distracted is attempting to be somewhere else, and training in coming back to exactly where it is now is a good way to work with your habitual behaviors (procrastination).
Meditation changed everything about my life -- similar to the OP I also slid by on smarts and not hard work, but started practicing meditation in college due to general anxiety and went from a B- to A+ student--I didn't even work longer, but just had more focus and mental stability on the task that I was performing at hand, which ultimately allowed me to get more done.
Plus, once you're in the habit of applying some type of discipline that's not about the end result (e.g. I always gave up on projects because I wanted them to be amazing right off the bat) it becomes much, much easier to be willing to put in non-grandiose, day by day drive necessary to accomplish /real/ things. Put another way, when you pay attention to the details, suddenly that overwhelming urge toward "greatness" or "brilliance" fades away, and you can actually get things finished.
Agreed, don't beat yourself up about this. It's a very human problem, and even recognition of your current circumstances is far and away above what many people ever accomplish.
Thank you, I should have mentioned that Mindfullness is an evidence based therapy for a bunch of things (depression, anxiety) and has also been shown to improve concentration (especially in heavy multitaskers - I believe the study was personal assistants.)
Regular exercise stimulates the production of new neurons in the brain, which is a normal process found to be slowed in depressed brains. (the research was presented at a conference, but not yet published as far as I know.)
Mindfullness training has clinical evidence as a treatment for depression, anxiety and other psychological illnesses, as well as having been shown to increase concentration span and effectiveness.
Not everyone has these issues; perhaps I said it wrong. All "normal humans" are subject to depression and anxiety cycles, and have brains that use the same "cognitive energy" for both thinking problems and willpower. Assuming you don't have an abnormality in your brain structure (would be highly unlikely), these techniques will (most likely) help with the problem you describe. Of course, it's only medical science, so it's sometimes wrong for one individual.
1) don't waste cognitive energy on silly tasks (games, arguing in comment threads, etc.)
2) practice exercising willpower - it's a muscle, you can train it to be better. Start by forcing yourself to complete a routine every morning (the trick with habit forming is to not give up after you miss a day.) examples of habits to form below.
3) look into mindfullness meditation[2] - this can help you identify distracting thoughts as they arrive and practice ignoring them.
Meditating is a good habit to form as practice, and it will also help you get better at habits. You could also exercise on a schedule (and record when you do, including how heavy you lifted/how fast you were running). Eventually, with a stronger willpower-muscle, you'll be able to choose the fruit salad over the cake, even when you've just spent your 7.5 hours a day coding.
I've not found pomodoro to work for me as an easily-distracted person, it's better when you're prioritising work tasks (e.g. 25 code vs 5 email) and even then, 25 mins is too short for good programming "flow".
This is a hard problem, everyone has trouble with it. Good luck!
[1] http://seriouspony.com/blog/2013/7/24/your-app-makes-me-fat (HN discussion: https://news.ycombinator.com/item?id=6124462 )
[2] http://www.amazon.co.uk/Mindfulness-practical-guide-finding-... (US edition: http://www.amazon.com/Mindfulness-practical-guide-finding-fr... )