How to Learn Coding P1

Posted in tutorials work -

A buddy of mine from college just started learning programming in Python, and he told me that it was “very complicated” and there are too many things to remember, which he normally mix up. As someone who just started teaching himself to code a few years ago, I understand the feeling, and for that reason I would like to write this post to share some of my experience. Hopefully it will have the chance to help some of you guys out there, who, like my friend and I, want to learn programming but find it too challenging.

In this multi-part article, I will list out some points which I find most important for someone who wants to learn coding by themselves, especially for someone like me: at an “old” age (I was 26 when I started). Anyway please keep in mind that the list might not suit everyone (some items may be very important to me but only slightly important to you and vice-verse), so if there’s some other stuff you find challenging and you want to know more but is not in this list, please don’t hesitate to write me an email, I’ll be glad to help!

This is one part of a multi-part post. To see other posts in the same series, please click below: Part 1 Part 2 Part 3 Part 4


1. Have a growth mindset

“Growth mindset” and “Fixed mindset” are the terminologies that were used by Dr. Carol Dweck in her fascinating book Mindset. Basically, these terms describe two ways people think about someone’s “talents” in some particular field: people with fixed mindset tend to think that talents are something you’re born with, so naturally if you have a try on some field and suck at it, it means you don’t have the talents so there’s no point trying. On the other hand, people with growth mindset believes talents are learn-able: they may start off not so well but they trust that with hard work and continuous practicing, they will get better. And several scientific experiments have showed that the growth mindset guys are normally the ultimate winners.

(Of course that’s a super over-simplified version of the book, but normally when I start to talk about this book, I tend to go very lengthy and far away from the original topic, so I think I should stop before it’s too late :D I will have a book-review post about this awesome book another time, it was a life-saver for me at the time when I felt like a loser, which is also the time I decided to start learning some coding.)

Back to the topic at hands, having the belief that you will be able to do it despite how bad you are right now is something you must have, otherwise you’ll give up pretty early. This is especially true for someone who start learning something difficult like programming at not a very young age, due to two reasons, and I’m gonna explain one by one

  • You’re in “panic” mode: When you’re in high school or college, your life have less things to worry, and you have more time for yourself, which means if you learn something and later on find out it’s not for you, you won’t feel like it’s a big deal; however, when you’re older, you start to value time more as you have less, so if you attempt to do something and find it very hard, your adult mind will urge you to give up, because you don’t want to waste your time. That’s a totally normal and useful feeling that saves you from doing all kinds of things and focus on some of those that are the most important for your life.

    But I’ll tell you what: learning to code might be one of those (very few) important stuff that you should give up at least a few months of your life to figure it out. Even if you’re never gonna be a programmer, having at least some basic skills of coding and how programs run underneath the fancy graphical user interface (GUI) will improve your logical thinking and give you a bit of advantage in interacting with technology, as they are everywhere nowadays (Btw, I intent to have several posts on how you should deal with technology in this blog). Some famous authors even suggest that either you know how to program, or you’re gonna be just another piece of program, like this book that I suggest you read if you’re still not convinced by my words.

  • You’re not fair and start comparing yourself with some programmer friend who has 10 years more experience than you. It’s understandable that when you start something, you tend to compare yourself with someone you know, especially someone who’re about your age and you have known for a long time. Of course, I know you’ve made your “adjustment”, but being a rookie, it’s very difficult for you to estimate how much someone in the field can learn in 10 years. I will explain this thing more carefully down below, but to be honest, I don’t have 10 years of experience so I won’t be able to give you a concrete estimate, but I guarantee that if you know what I know, you won’t feel bad about yourself at all for not (yet) at the level of your high school buddy who started learning to code at 18 anymore.

2. Be patient

From what I experience of many people I know (myself included), the most common reason for someone to give up on something is that at some point, the process starts to look dead-end to them. No matter how much time and effort (and sometimes, money, health and other stuff) they invest on, they see no improvements on the progress. Reason for this phenomenon is something called the non-linearity relationship between efforts and the results. To put it simple, even though sometimes we can spend hours doing/learning something but still feel like we have gone nowhere, later on a little effort (like 15 minutes) of the same action can take us from zero to hero in a blast. However, we wouldn’t have got to that “golden moment” when a little effort gives great returns if we hadn’t been through hours of “hopeless actions” when we keep doing the thing despite how much a dead-end we think it is.

Nassim Taleb, in his book “Fooled by Randomness”, brilliantly summarized it: “Our brain is not cut out for nonlinearities. People think that if, say, two variables are causally linked, then a steady input in one variable should always yield a result in the other one. Our emotional apparatus is designed for linear causality.”

Please be patient with the progress. From my point of view, facing the feeling like you want to give up (but still don’t) is the most challenging part of the game, and unfortunately, you almost cannot avoid it. Sooner or later, you will have that feeling, normally after spending hours struggling with challenging stuff without getting any visible results. Those challenges can be some bug on your code that you can’t find, some concept/idea that you cannot understand, or sometimes it can even be the fact that you have learned quite a lot, and the newly acquired knowledge made you realize that there are tons of more things that you need to know about.

One of the things that should strengthen your belief in yourself (and hence make those moments easier) is to understand how the knowledge is acquired. Scientists will have more accurate ways to explain it, but here’s what I always visualize the process:

Imagine you start learning something completely new to you (like programming) is like putting a seed on a wild land that has never been planted before. Really imagine how hard it is to keep that young tree alive and grow up: the soil is not suitable, and you have to put a lot of work on it. The tree is also alone in an empty land, so anything can go wrong: rain, thunder, waterfall, etc. It’ll surely take a lot of time to grow that tree.

Now imagine after that first tree grows, you plant another seed. Will it be as hard as the first one? Not likely, now you have your soil ready, you have the first tree that you can rely on, so the second tree will get an easier time growing up. And as it grows up, its root and branches will connect with the first one to make a small network, which reduces the time and effort you need for the third tree to grow. If you keep continuing like that, at some point you can start growing two trees at a time, then three, then four, etc. You’ll likely have a small forest just by double the time you spent growing one tree.

I hope that the visualization is understandable. If you don’t like it, then you don’t have to, just come up with your own visualization, just make sure it demonstrates the main point: starting up is always the hardest part. The more you learn, the faster (and easier) the process gets (When you have a couple of years of experience, you will start to be amazed of how fast you can learn.), so… keep calm and continue.

This is one part of a multi-part post. To see other posts in the same series, please click below: Part 1 Part 2 Part 3 Part 4

Written by Huy Mai