Learning to code is basically just going from one problem to another. Some of these problems are solved easily, but there are also situations where you just feel lost and frustrated. In these moments you wish someone else would write your code for you, implement the thing you don’t understand and then hand over the finished result to you.
The problem is, that this is how a lot of learners actually search for solutions. Especially on social media and under YouTube videos I see a lot of people asking not specific questions, but instead for the whole code of their desired feature/app/program. And I totally understand that. I have that frustration and feeling of being lost almost every time I am trying to learn a new concept. That feeling of “I will never get that, it’s too hard!”, and then I wish someone else would just write my code for me. But I am glad almost no one has the time and interest in building someone else’s program (open source projects aside), because it would pretty much kill the whole learning process. It is that struggle and intensive research about a problem, that uncomfortable pondering while going deeper and deeper (and opening more and more browser tabs), that really makes you learn and grow. If you just copy something, you might have your desired result right now, but it won’t stick in your head for long. If you on the other hand have to grapple with a problem, you will most likely remember details about it the next time you’re confronted with that or a similar problem again. It also teaches you how to think like a programmer and how to draw your own conclusions from the pieces of information you are given.
I know that it sometimes feels as if it’s just too much to learn. Too many things that you don’t understand and that all play a role in your problem and you want answers now. But you have to go through these concepts one by one. Learning is uncomfortable and no one really achieved something worthwhile by staying relaxed all the time. But it’s also this struggle that makes it so rewarding when it finally clicks and something works. If you don’t understand some code or a programming concept, you have to research. Don’t just ask your question on Stackoverflow or another community and then lean back and wait for answers. Instead use Google, read the documentation and source code and most importantly: try things out yourself. I figured out so many things by just trying that it’s a big part of my research process now.
You have to understand that this benefits you the most. You can’t become a good programmer (or good at anything) without learning to think like one. Learning how to understand pieces of code written by someone else and the bits of information you find online and in the documentation and then connect the dots to something that makes sense. If someone else always does this for you, you can’t get skilled at it.
This is also particularly true for the part of programming that is not so much about information and knowledge, but about the ability to think logically. In my opinion that’s one of the most fun parts about programming, but it is also very exhausting. If your code doesn’t work, approach it with the playful mindset of a puzzle. Change pieces of the code, compile and run it and then change some more code until it works. Explain to yourself out loud what every line in your code is supposed to do and what the next step is (or use a rubber duck for that job). Draw sketches if it helps. Just interact with your code and don’t just passively wait for results to come to you.
One of the (in my opinion) most important books out there for anyone who wants so learn something new and get better at it is “Mindset” by Carol Dweck. If you haven’t read it yet, don’t wait. Buy it and read it. Just look at the books ratings. Yes, it is really that good. It explains the difference between a growth mindset and a fixed mindset and I have already talked about it in my How a Growth Mindset Makes Learning Programming Easier blog post. Adopting this mindset is crucial if you want to thrive in the face of discomfort and struggle.
I wish you all a lot of success and fun on your programming journey and remember to not get frustrated when things don’t work out immediately. That’s completely normal 😉