Struggling with learning to code? Here are some heartfelt coding advice from one of our senior mentors at NEXT Academy, Sergio. Hope you'll find inspiration in this post whenever you're facing roadblocks with your code.--I want to share something, it's about a story almost a decade ago, it's my first experience as a programming teacher.
After reaching the national level for a programming competition, I came back to my high school as alumni. I was determined to share my knowledge with my juniors. I was appointed by the local council committee, to provide training for the preparation of a programming competition. I acted as a mentor for 2 students for a week. They were brilliant. One is smart, the other one is hardworking.
On my last day, I gave them a book about algorithm, I told them to read it and do the exercises. The smart one seemed to ignore my advice, while the hardworking one chomped down the book silently.
Later did I know, the smart one didn't pass preliminary and the hardworking one didn't pass as too, yet the hardworking one achieved a better result than the smart one, way better.--Now, if you are new to programming, you might have no idea how things work, you just copy what you see, you use other people's solution blindly, you are a script kiddie, and that is ok. It's the first step.
Some people learn very fast, everything just "clicks" for them, while some take a longer time. A day, a week, a month, or more. (Personally, I am the slow one). However, whether you learn fast or slow it doesn't matter, the one that matter is that you do.
You try, again and again, it doesn't really matter whether you understand. Do again and again, try a different way, try to implement it differently, try to break it, make errors, crash your app. It's ok, it's fine.After days and hundreds of lines of misunderstood code, I believe you'll find a silver lining, you'll start seeing patterns, you'll start understanding what works and what doesn't...and hopefully why it works.
Programming is a skill, it's the same as swimming, cycling, or cooking. You'll have difficulties to learn just by understanding. You need to do to understand, you need to fail multiple times, and get up once more, to understand.
For my current students:You definitely cannot swim if I only tell you to move your arms at certain speed or angle. I'll show you how and you need to try it, to copy it, while I hold you, taking care of you in case you couldn't. And over time, once you get used to it, I slowly let you go. Even so, you might accidentally drink the water, yet the more you do, the more you can.That's how programming is, you just need to do it. Type the code, compile it, if it's wrong, find out why. If it doesn't work, found out why, try a different approach, try a different solution. Code!