How to learn programming the natural way
May 30, 2018•770 words
Some years ago, I had a fellow developer ask me where I learned to type on the keyboard. I said, huh? What do you mean. It’s a keyboard. You just tap on it, and eventually you get rally tappy on it. I’ve been doing it since I was three feet tall. He said oh. “I took one of those Mavis Beacon typing classes.”
Both of us, at that point, were equally proficient in typing on a keyboard and understood the super complex mechanics of hand placement and proper finger etiquette. I learnt it absentmindedly, and he learned it brute force. The result is the same. One method is just less exhilarating.
As I’ve stretched through my expanse of time, I’ve found it somewhat increasingly difficult to teach myself new tricks. As a kid, learning is a thing you’re always doing. As an adult, learning is something you need to make time for. Today, programming is as gushing a prospect as gold in the old west. And right before you are all the tools you can possibly need. Tragically, the burden lies on you: will you put in the time?
But as I’ve heard from others, and read on blogs about people’s journey to learn programming, two things are mentioned very often: it’s very hard knowing where to start, and it’s very hard even after you know where to start.
So lots of people give up.
I’ve given up on many, many things in my life. Programming was not one of them, and I’m grateful to my past, clueless self. But that’s exactly it: I learned programming not because of some grand insight and keen forethought. I learned it because I wanted to change the damn color of some rectangle to red.
That’s it. That’s all that's needed to learn programming. You can read hundreds of blog posts and watch a dozen videos on how to program, and at the end of it still be completely incapacitated. Or, you can feel your way through it. From an end result, work backwards, rather than forwards. That is, rather than starting from the absolute beginning (which is completely maddening by the way; blank slates are the most uncomfortable point of any project, even till this day), you start with the end result already in front of you, and you tweak some tiny variable, and you see how it behaves.
That’s sort of how machine learning algorithms work, isn’t it? You try this statistical possibility, observe the result, and give it a thumbs up or thumbs down. Eventually, it finds a way. You, a machine learner, do the same: find the source code of a complete project, set up the environment (here be dragons), and get the app running. Then, find one thing you want to change about the app, like a color, font, width, height, and figure out what file you’d need to change to do that.
Changing a green rectangle to red might take you hours on the first attempt. Maybe even days. You’ll have to google yourself to exhaustion, in ways you’ve never googled yourself before. Eventually, of course, it becomes common to you. So you give yourself harder and harder tasks. “Ok, I can change the rectangle to any color I want. Can I make two rectangles appear side by side?”
Follow that path, continually make new challenges for yourself, and eventually, you’ll know how to program. Programming isn’t a bunch of rules you need to learn in some strict order, and even if it were, it might take the rest of your life to learn them all. Programming is just this language you learn to speak in varying degrees. You never quite master it. You entertain yourself with how expressive you can be with this newfound language.
But you learn to speak it, just by speaking it.
My wife gets notified of new blog posts, read this one, and said that it inspired her. She said, however, that it might be helpful if you included some resources in the post. I said, well that's the whole point: you don't need any resources. You just need to find an opensource project, and run it. She said, run it where? I laughed. Ok, so obviously, there are different levels of expertise here. But, the point is, you should struggle a little bit. It's ok not knowing. As long as you have an end goal, and are determined, you will find a solution. You can start with running the encrypted notes project I work on called Standard Notes. It's in JavaScript, and setting it up locally is not too bad: