If you go to the gym and do some reps, you get muscle.
If you practice on something hard for 1 hour a day without any help
and explaining it, you get to learn it.
OK here's my proposal:
Lately, I've been doing a programming training that I like to call
"freecoding". I got this from the term "freewriting" in which writers
would type all the things in their heads in a limited amount of time. For
example, if you want to make an essay about dogs, you would spend 30
minutes writing all you know about dogs without being bothered by
grammatical errors. After you are done with freewriting, you are ready to
put some structure in your essay.
For coding, it's sometimes the same idea. Personally, I get bothered that
I always face the same problems in design and by the time I'm done
building an app or a template, I give a quizzical look at my code
and ask if I really know what I'm doing. Or if I'll be able to understand
what I've written and coded it the same way without looking at it.
For this, I have started something I like to call "Freecoding".
I recommend to do it in an hour, but you can do it for 15 or 30 minutes.
It consists of choosing a problem or an app you have/want to work but
don't really understand the concept quite well. Then work on the
app/script for 1-hour explaining what are you coding without watching
any source to copy.
**Don't worry if the app/script doesn't work, just push yourself
to code it as a much as you remember and understand**
Remember, this is "Free" coding after all. Also, if it's not working,
ask yourself why and write it down. Once you are done with freecoding,
revisit the part you didn't understand well. Also, keep your code.
(At least for 1 week to review your progress)
For me, my problem was creating API's using express.
So, I spent 30 minutes each day working in building API's by trying
to remember how it was written. One thing I would suggest is to watch
the code before doing the freecoding and avoid all temptations of
watching the source.
Try to choose easy problems to remember. You can't make a whole app
in 1 hour, but can build a piece of it until you can try to make that
app from scratch.
This might be a very intuitive way to learn to code, but after
trying this method for two months, I feel much more confident in my
programming skills and I know how my code works to the point that I
can now improve it.