I used to be in this position. Your question really resonates with me.
I think I have broken the cycle, but it is hard to be sure of something like this of course. I have certainly been able to make more progress on projects than I have been able to in the past.
I think this has helped me:
- Make a Someday/Maybe list. Capture your ideas and put them on the list. This can just be a text file. Feel free to add implementation notes. Then, when you have time, you can come back and see if the idea still compels you. The examples you give, for example, sound like things I might have on my own "someday/maybe" list.
- Evaluate your ideas/projects. Do they spark interests? What are the reasons why you desire to complete the project? Do you think that desire will carry you through to project completion?
I'll give you some examples of myself:
For a time, I was really unsure what I wanted to do after I became dissatisfied with Ruby. I wanted to keep exploring functional programming, especially pure functional programming. I also really wanted to work with the actor model, and at the time Rust 1.0 was just being released, so I started working on that at the same time.
At the time I played around with a lot of things. But I ended up focusing on learning Haskell, and my goal was to completely work through this book https://haskellbook.com/. I was able to finish this after several "false starts" with Haskell over the years.
Why did I keep working on this project, instead of any of the other myriad shiny things that pop up on HN? Well, a few reasons:
- I really wanted to familiarize myself with pure FP. I had become dissatisfied with OO techniques, slowly thinking of them as an evolutionary "dead end", and wanted to explore something else. IMO, Haskell was the best way to explore this.
- I also really wanted to be able to "read" Haskell. Generally speaking, Haskell has become a sort of "lingua franca" in the functional programming community. You often see snippets using its syntax and read concepts explained using its ideas. When I encounter terms like "typeclasses", I wanted to go from "eyes glossed over" to "comprehension".
There are more reasons, but suffice it to say that I thought that given my long term goals, not knowing Haskell had become a stumbling block. So, I decided to change that, and working through the cited book has worked for me.
I didn't only work on this project. I did take a few breaks here and there as needs must, and interest naturally waxes and wanes, but the motivation held and the project is completed.
Having completed it, I have a few new projects that also have compelling reasons for me to work on them. I have flip flopped between them at different times, but there have been good reasons for doing so, and the reasons have not been because I lost interest, but because of external factors.
- Realize that you will still sometimes just desire to experiment with something for a little bit. That's OK. The other day I downloaded and messed with Electron. It was just something I wanted to try out and satisfy my own curiosity for something random. But you should think of this as being a time-boxed experiment, and not something that you are committing several years of your hacking life to. Unless, of course, it is, but in that case, count the opportunity costs before mentally committing yourself.
-----
Edit:
I forgot to include this link; I think it might help you too. http://blog.fogus.me/2015/11/04/the-100101-method-my-approac... It has been discussed on HN a few times.