Throw away your first draft of your code
ntietz.com
ntietz.com
The article is good as far as it goes. Yes you do start off knowing nothing about a project. Along the way you run into roadblocks, and you learn something when you work your way around those roadblocks. Then you strike another roadblock, and work your way around that one too. Rinse, repeat.
By the time you're a good way into the project, you will probably think "I should have done all that foundational work at the start differently".
It's often said that you should build three houses before you get the basics right enough. Been there, done that. I built one large, expensive house. Made so many mistakes that I won't do that again. Hence the reasons behind 'Build one (cheaply!) to throw away."
We all should have a 'pet project'. That's a project you do for fun and learning. Every now and then you haul that project out and rewrite it from scratch.
You may rewrite it in a new programming language or two, thus adding whole languages with their good bits and 'gotchas' to your repertoire.
You may rewrite it several times so that your project changes at every stage from being a plain old text-based project that writes to a terminal, to one using curses and different ways of writing and displaying stuff on a 'panel', to being a GUI-based project using GTK+ with call-backs, bitmaps and idle-timeouts.