It's no surprise that learning to code is extremely difficult at times. Similar to learning a new speaking language, you have to understand a whole new syntax, flow of the language, and how it's best used. Additionally, if it's your first programming language, it's even more confusing!
As I have ventured through my journey I have encountered three "must have" components, to problem solving and "thinking in code":
- Understanding what the problem is asking
- Comprehending how to implement those core principles
If this is your first coding language, I know it is intimidating! Truth be told, I'm still intimidated from time-to-time! I've composed three basic, yet essential, tips that I find are great for learning this new way of thinking!
You've got to study!
When I say this - I mean it! Diligence, hard work, and constant studying are key. Anything in the programming world is always in flux. Syntax changes, new libraries are introduced, things are revolutionized so frequently, that you won't really know everything... ever!
Let me say this:
You don't know, what you don't know!
Wait... so you want me to:
- Compare that to the money in my drawer
- Decide if I have enough money to produce change for your item
- Actually, manipulate those values in my drawer appropriately by how much cash was received
- Then, return the amount of cash left in the drawer?
Something of the sort seemed genuinely impossible! Wizardry! Voodoo Magic! How was I supposed to do all of this with just simple array methods, when all I learned was how to
.pop(); something off of an array?!
The best way to relate this to something not coding related would be something like cooking. When you've never cooked a single dish in your life, you have to read recipes. Digest that new way of thinking! What needs salt? Does this need sugar?
If you've never cooked in your life, how are you supposed to know that chocolate doesn't go inside of your bean chili?
... okay, maybe that's an extreme example, but you understand my point!
It's part of the learning process!
While yes, studying is definitely key to learning something new, oftentimes in a situation like this, seeing how it's implemented is a tad bit confusing. This brings me to my next point...
Watch other people solve problems
There is an enormous amount of value in watching someone else solve problems, and plenty of ways to do so!
- Read forums
- Talk to other people are similar learning stages
- Look at the variety of solutions to code challenges
I neglected this aspect for a while, because I wanted the pride of solving a challenge on my own. What I had learned though, was that in the beginning, most people can not. It's not that you are terrible, or will never understand, but it's an entirely new way of thinking, you can't expect yourself to become a coding master within the first 60 days!
When I started reading other individual's solutions to coding challenges, my mind began blossoming with ideas on how to solve old problems I struggled immensely with!
Back to my cooking analogy - you may create a habit of cooking a stew, or baking a cake a certain type of way.. yet, how will you ever know the alternative? What if someone else's cake is always higher quality?
This is when you learn from those other people! Watch their style, the technique, the finesse, if you will! Definitely don't copy their style, but learn from it! Take bits and pieces, and make it your own. This is a great way to learn!
To segue into the tip that ties everything together..
You actually have to TRY
Learning to code is emotionally draining. When you are first struggling through those initial problems, it is extremely unmotivating. It's easy to just wish that the skills will seep their way into your brain... and they will.. if you practice!
None of the other tips will be of value if you don't put in effort. You are going to break code, your solution will be completely backwards. You are going to fail!
However, isn't that the case with any new skill?
Returning to my kitchen analogy, have you really learned how to bake, if you've never burned a cake? As someone who has spent a ton of time working in restaurants, I can confidently say I learned the most when I destroyed things!
Overcooking pastas, totally scorching pizzas, dropping steaks on the floor, forgetting you have something in the oven - these mistakes are what help you learn!
This is the same way with code! Mistakes are your friend, and there is a lot to learn from them. I can confidently say that even if you spent hours trying to solve a problem, and it turns out to be wrong - you still learned a lot from those hours!
Countless times I have invested my day into solving a problem, just to discover I was attempting to solve it in the entirely wrong way! However, during that time, I picked up some new methods, implemented some new code, and pushed my boundaries.
My point? Similar to any skill - failure is part of the routine. Strive to fail! There is a lot to learn from broken code - trust me!
Tieing it all together
In short, learning to think in code is a process. You need to expose yourself to the benefits of your language, whether that's loops, array, objects, classes, or something else! Watch other's on how they implement these skills, and create your own flow. I've found inspiration from many other people, but ultimately created my own problem-solving style.
Finally, the most important of them all: fail.
When I wasn't failing, I definitely was learning. It's comforting to stick with the easy problems, and write a function that adds two numbers all day, but that's not when you learn. You learn when you really stretch yourself. Mess up, fail, and then try again!
Top comments (9)
Great post! This is some good advice for those who are just getting started learning to write code. It is easy to think one should get things quickly as it appears so many others do exactly that. But, in truth people have put in the time and effort to develop their skills. I also really love the value of failure. One definitely learns a lot more failing at something they didn't know everything about than doing something in their comfort zone.
Words of wisdom, man! Couldn't agree more. It's definitely comfy to stick to the "familiar". But going out of your comfort zone has a great amount of impact! Glad you enjoyed the read man, means a bunch!
Nice post! I think that the most important components of the "must have" ones is "Understanding what the problem is asking".
There were times where I spent a huge amount of time thinking that I was solving the problem to, at the end, find out that the question was asking another thing!
I still find myself in that exact situation! It's definitely tricky, and becomes clearer I've noticed, the more I slow down and take time to absorb the question. So true! Keep up the great work!
Nice post !!! These are good tips to learn how to solve a problem, but sometimes more than knowing the syntax it's hard to find what you need to do to solve an activity first, even if you knew everything.
Inspiring post Dylan, no body exactly tells you how to think, i think this article is really beneficial & helping for the beginners like me..:)
I'm so glad you found it valuable! It definitely can be tough, and I'm still learning as well! Always learning, always growing. :) Keep it up!
Nice article 🔥
Amine! Thanks so much! Super glad you enjoyed it - means the world! 😄