In short, when you have planned or have thought about an idea to create - what do you use to help keep you on task, or to make sure you stay programming without (negative) distraction?
I've found that reading books and being around like minded people does help with motivation, although when it comes time to being by yourself typing away on the keyboard again, that it's very easy to get lost tracking websites that are not related.
Could anyone recommend a mindset, or approaches you've taken to maximise your productivity?
I usually start by killing my internet connection, otherwise I know it'll just be a matter of time before I'm surfing away on totally unrelated pages. Also, I usually plan my time ahead of starting working, and make sure to incorporate frequent short brakes (for example, work 45 minutes, 15 minutes break, work 30 minutes, 5 minute break, and so on...). This way, if I get hungry, I need to wait for the next break before getting something to eat, which will help me focus just because I know it's no point in thinking about food prior to the break. And if you manage to get into the mindset of "if I do this now I won't need to do it later", that's always a good place to be.
Finally, loads of coffee and a comfortfable working position (lying down in the couch with your computer on your tummy isn't a very good position for working) are probably my best tips.
Good luck on your motivation!
I believe it really only goes as far as your will is willing to take you. At least for personal projects. If you code without any motivation and you want to quit, chances are you wont be able to focus and your code will be horrible.
I find that setting out a TODO list, and giving myself personal deadlines to get certain things implemented keeps me going. It's all about the fun of a challenge for me. Like you mentioned, talking to like-minded individuals about your project and seeing their enthusiasm can really get you going. Setting aside a specific time to just sit right down and code, a time of day where distractions will be minimal and you have time to think and relax can really increase productivity. As for keeping your head in the game, the only way to do that is to really make sure distractions are limited. Distractions like Stackoverflow for instance ;). If you're on a computer and you are bored with coding, it's hard to stop your mind from finding other things to do. Chatting on MSN and answering Stackoverflow questions can't co-exist at the same time with coding!
Getting Things Done:
For me it helps to write a todo list and keep it update as long as I move.
1- write the unit tests for class X.
2- write class X.
while writing class X I run into a brickwall, Before I turn to the all mighty Google for assistance I add another item
3-find out how to implement feature Y.
and just cross off items as soon as I am done with them and try to log how much time it took me for future reference.