If that title doesn’t describe why coding is so confusing, I don’t know what will. And I know it sounds pretentious, but that’s by default, coding is weird. This might be the core problem with learning to grasp code: the fact that you’re working with “objects” that can’t truly be seen or touched.
If I had to describe what I see in my mind’s eye when I’m coding, I think it often looks like imagining my own auto-complete. When you look at a Keyword in code, your mind has to be able to visualize what happens when you add a Dot to it. Eventually these “words” actually feel like concrete objects to your mind. After you become familiar with a system, one glance at a Keyword and your subconscious hits the Dot and shows you what’s inside that object.
The biggest issue is that working with the subconscious mind takes time. You simply cannot force it to build all the neural pathways necessary to get all of these concepts associated with each other. And unfortunately the best way to build the strongest pathways in the brain is through making huge mistakes. That’s where experience comes in, and you get the best kind of experience through playing, not by working fearfully under pressure of a deadline.
If I could go back and give advice to my younger self, it’s probably not what you’d expect. When you’re pushing too hard, trying too many shot-in-the-dark approaches, and just can’t seem to get things in the right order, it’s time to reboot your brain. Take a nap, go to sleep, or better yet, take a bath with the lights off.
Now I’m not saying it’s a bad thing to get your mind in the habit of constantly trying to fix code through brute force. Thinking about it constantly in waking life is what will train your subconscious to keep doing the same thing in your sleep. The trick is to allow this to happen, because you have to know and feel that your mind will do this all by itself. The subconscious operates on feelings, and if you’re afraid of coding in real life, your mind won’t do much coding in your sleep either. Not that I wake up knowing what to code, I don’t actually dream about coding. But so many times the idea doesn’t click until I wake up.
Once you’ve reached the point where you are “fluent” in a coding language, you will have a genuine feeling behind each Keyword of every line you code. If you’re still working under fear, hoping that this next line of code will work, that fear will keep piling up onto other fears.
But there’s nothing to worry about, that fear will never go away so just deal with it. I’m being silly and harsh at the same time, but the “don’t worry” part is true. Just because you keep feeling afraid of getting things right doesn’t mean you’re not capable of solving the problem and you should stop.
It’s actually very good news to know that your fear won’t go away. If you expect that things will some day just suddenly get perfectly 100% easy, that’s just a fantasy we all have about any skill. Of course it gets easier, but anyone with experience can make something look much easier than it is, which gives you the false impression that once you learn it, everything is effortless.
I think the last thing an expert wants to admit is that even at their level, sometimes there are still huge challenges, which can be even bigger when you’re expected to easily overcome them with your expertise.