Try building something instead of learning something.
Also while programming I find I can stay productive if I always leave my project workspace where there's a bug or half-implemented feature I can start the next day.
I think this is good advice, and you're hitting on one aspect of my aforementioned 'productive mania'. When I started programming, I almost immediately went into building projects I was interested in, would use personally, and friends would use. That probably hard a big impact on why I was SO driven, SO productive, and SO energetic.
I try and work on projects like that nowadays, but I can't hit that extreme level of productivity and excitement. It seems that another aspect of that mind state, was that the 'newness' of programming coupled with the success I was having at it BUILDING something, brought heightened mental activity.
I just wish I could tap into that nowadays. Unfortunately, it seems like the brain comes alive most, in a novel environment.
To expand on your first statement, it's helpful to have a project you are interested in using once its operational. Learning something for its own sake isn't very motivating. But if learning the skill allows me to do something I am truly interested in, then the learning is just one of the steps in the process, and you have a much more directed approach.
It's the difference between "figure out how to use websockets" vs "build a temperature controller for a smoker that is accessible from a webpage, using websockets".
Anecdotal advice: in my first year of university we were taught how to write programs in Java. During the summer after, I spent my free time trying to use what I learned to make little games. For each feature I implemented, I got experience with things like API documentation, file I/O, OO programming, etc. I learned a lot of new things, and was motivated to learn because it gave me something I wanted.
I try and work on projects like that nowadays, but I can't hit that extreme level of productivity and excitement. It seems that another aspect of that mind state, was that the 'newness' of programming coupled with the success I was having at it BUILDING something, brought heightened mental activity.
I just wish I could tap into that nowadays. Unfortunately, it seems like the brain comes alive most, in a novel environment.