I have been learning how to code, on and off, for quite a long time.
I want to outline what I did that worked for me, and what I did that was a complete waste of time.
What I Did Wrong:
Oh man... So many things...
Mistake 1: I half-assed big languages.
I started out my journey by learning Java. I figured if I study for a bit, and make some game, it would be fun. This was a few years ago. What ended up happening? I spent countless hours learning all the basic syntax just to realize I can't really build a useful application on my own. A language like C++ or Java, only becomes useful is you are an expert, or you are working in a big team. The problem is, it is hard to become an expert when you do not get to achieve any meaningful short term rewards. At the end of the day, I did not end up making any games my own, except ones I made following tutorials.
Mistake 2: Relying solely on YouTube.
YouTube is an amazing resource. That being said, when it comes to doing any significant work in programming, you have to do a lot of reading. I spent COUNTLESS hours following YouTube tutorials, and I feel as though that was not the best use of my time at all.
What I Did Right:
There are some!
Success 1: I started small.
After numerous failed attempts at my big ambitions, I started again with smaller goals. A simple input-output app. Some calculations, etc. This led to a bunch of micro-successes that boosted my confidence and inspired me to continue learning.
Success 2: Applied it at work!
I saw things that could be automated and started applying coding at work. I managed to make a few apps that saved a BUNCH of time and increased accuracy a quadrillion-fold. This felt great, and again, inspired me to keep at it.
Takeaway:
Some people have extreme talent. If you are like me, and don't have this, it is important to set goals that give you short-bursts of success to keep you going. It may feel like you aren't doing much, but it will pay off. As of now, I still consider myself a higher level noob at best, but I can clearly see a trajectory of how I am going to get better. Having that clear vision makes it much easier to put in the effort to learn.