Not to toot my own horn, but this is exactly the approach I take when I teach students to code (which I have done quite a lot of).
You can see the basic sequence of projects I use here[1]..
Then at Zed Shaw's prompting I wrote a book: Learn Java the Hard Way[2].
[1] http://programmingbydoing.com/ [2] https://learnjavathehardway.org/
Doing project after project, each stretching your ability is a really good way to learn ANY skill, but especially coding.
Not to toot my own horn, but this is exactly the approach I take when I teach students to code (which I have done quite a lot of).
You can see the basic sequence of projects I use here[1]..
Then at Zed Shaw's prompting I wrote a book: Learn Java the Hard Way[2].
[1] http://programmingbydoing.com/ [2] https://learnjavathehardway.org/
Doing project after project, each stretching your ability is a really good way to learn ANY skill, but especially coding.