What the vast majority don’t know about learning to code

What comes to mind when we think about learning coding is usually formal instruction. We think about classrooms and lessons and homework. We think about reading the instructions, looking at textbooks and going to the library. If we are younger we think about internet searches and Youtube videos. When it comes to coding though, all of these activities miss the mark. They are all just different forms of accessing facts and that ISN’T going to be enough.

Don’t get me wrong, facts help. But with programming, we can have all the facts memorized and still not be able to code.

It turns out that learning coding has a lot in common with learning other difficult things. Things like learning a foreign language or learning to play the guitar. Just like with programming, we usually to conquer these problems by acquiring the facts. We buy a book, or find a Youtube video on ‘Easy Spanish lessons’ or ‘Learn to play any song with guitar tabs’. Then we sit down and do a couple of lessons.

But what we find out pretty quickly is that while some of the problem is that we lack knowledge, having all the facts clearly isn’t enough. Even if we do a lot of lessons, we still find ourselves pretty far away from the skill we want.

I for one have struggled to ‘learn’ two foreign languages and in the case of French I studied pretty hard in grades 8 to 12 and actually got pretty good grades. I know about 90% of irregular verbs and most nouns. I can also spell most words in French even if I don’t know what they mean. So I have the knowledge and the facts, there’s just one problem- I can’t speak French or understand it very well at all!

So let’s go through this again, just so I’m clear. I can pass and have passed innumerable French tests. When forced to come up with a verb tense, I can think about it and usually do it. I can read words and know what they mean. I can spell words. But I can’t speak French or understand it well.

Wait, it gets worse. I’ve worked in France, stayed there many times, toured Paris, etc. I tend to try to blend in wherever I go, so people on the street come up to me and think I am a Parisian and ask me where a certain street is or if the store is open. Indeed, sometimes I understand a word or two of the question and manage to put together an answer. That does happen sometimes, but not very often. Most of the time I don’t know what they are saying or else I can’t string together an answer fast enough to answer them. Conversations are pretty much impossible.

I’d sum it up like this: basically, it’s a bit of a surprise (miracle?) and certainly a rare delight when I understand what someone is saying and manage to respond in a way that they understand me.

Is that unusual? Actually, I don’t think it’s unusual at all. I daresay there are millions of people just like me. What’s missing? For the most part I am missing practice. To be more specific, I am missing things that can ONLY be learned from practice.

For example, one of the things that you learn on the streets of Paris is that nobody has the same accent as the teacher you had in French class. They also don’t speak slowly, or simply, nor do they only use words they know you will understand. They don’t know you are just learning French and they don’t repeat things 5 times slowly with some pantomime thrown in till you understand.

Real people speak differently than your teacher and your French lesson on Youtube. Without a boatload of practice you can’t even going to recognize when one word starts and stops, never mind what a stranger is urgently asking you.

Book learning simply doesn’t prepare you for that angry Moroccan, in traditional dress, lashing out at the cost of the underground parkade. At least I think that’s what he was talking about.

Like I say, in my case the facts are all there. If I watch a subtitled movie for example, let’s say a French movie subtitled in English, I can recognize the words being said in French because I get enough of a cue from the English that my brain can piece together the French. But turn those subtitles off and I am lost. I just can’t do it.

When I did stay in Paris for 10 days or so I got a lot better. I would have brief conversations with the person at the bakery, the coffee shop, the pastry place every day. (It was Paris after all!) Little by little I got better.

My confidence improved, my ability to distinguish words improved, my understanding of how people greeted each other got better, my vocabulary moved from the very, very back of my mind nearer to the front let’s say. But then I would leave and pretty quickly I slid back to where I was.

I wish I could say that several trips to Paris eventually gave me the practice I needed. But it’s going to take a lot more than that I’m afraid. Again, I don’t think this is unusual at all.

Now let’s go back to coding. The truth is that just like the situation with French the world is full of people that have taken coding classes and have done well on coding tests but couldn’t write a program in the real world to save their life. I think the reasons are similar.

Just like in French, real coding problems don’t come at you like they do in the textbook. It isn’t clear where to start and unless you’ve practiced a lot you just don’t know what to do. Ask anyone who hires programmers (or people that hire someone to speak a foreign language). Academic knowledge and achievement mean very little to success in these kinds of real world jobs.

A lot of people can maybe read code and given enough time, figure out what all the parts do. That’s kind of like me understanding the teaching and responding with a memorized phrase. Actually understanding what you need the program to do and creating code to do that efficiently that is way harder.

Think about the skill of ‘learning how to drive’ from a book versus mastering a driving simulator versus actually being able to drive on the road. There’s a pretty big gap between each step. Everybody knows this, it’s even written into our laws. To legally drive you need to pass a written test (facts) and the road test (something that takes practice). And we all know which one is harder.

Think about the first time you came upon a traffic circle or had to exit off the freeway in heavy traffic. Knowing what to do is DIFFERENT than actually being able to do it on the fly. The road test takes practice and often a failed test or two before a person manages to pass.

In fact there are some things you can only learn by doing. For you guitar fans, knowing the fingering for something like an ‘F chord’ is one thing. Actually having the strength, coordination, nervous system training, experience and confidence to do it in a song is a lot different.  No amount of reading will ever help you finger that chord. You have to practice it to learn it. Period.

As a society, we understand that many things are this way. But we don’t view programming as a ‘practiced art’ for some reason. The programming theory that people (hopefully) get in school is useful, but it’s only a very weak beginning.

Programmers get rusty the same way that musicians do when they are out of practice by the way. If you leave it for 6 months or longer, or don’t work in a certain programming environment for a few years, when you come back to it you will be a bit lost. If you’ve done it before it comes back really quickly. But if you never ever took the time to master it in the first place, you still need to do that work.

The music analogy holds for coding at a very high level of speed and proficiency. For musicians to perform at their best, they need to be practising almost every day.  In my case , it takes a few days or weeks of full time coding to get all the knowledge right at my fingertips. Then I can really fly though things. For years now I have planned on that phenomena happening, basically forcing myself to put in the time even though things are going slow. I keep getting faster and after several days that magical proficiency comes together.

So what to do if you want to learn to program? One of the advantages I had was that I learned on machines where it was a lot easier to get into the code for the program and figure out what was going on by observation. Unfortunately that’s rare nowadays. If you play a modern game, you simply can’t access that code.

That’s something that the folks at Raspberry Pi recognize and they built a instructional machine for just that purpose. To let young people get that practice that they so badly need. So that’s a start, establish a coding environment where you can observe and interact with something that is already established.

Repeated observation and practice is the way everyone learns to speak their native tongue. If you or your child puts that same kind of time in, proficiency with coding WILL come. Having something fun to work on and keep you motivated to put in all that practice will help. For kids game projects are good. For older people, they need to find something equally motivating: thesis work, a social project, a business idea. These things help with motivation.

I do think one of the few exceptions is a good course of study laid out by an experienced programmer. The body of knowledge you need to master the modern systems of today is huge. I learned the ‘Ruby on Rails’ environment some years ago. I taught myself and this was in the early days of the system so a lot of it was still under development. Even though I was experienced, it still took me about a year to develop a real application in it. If someone could have helped me through some of the most difficult parts I would have saved a lot of time.

A good teacher will speed you through some of the problems that you are going to come up against and also help motivate you when the going gets tough. All that will help, but it’s still on you to do the work.

I spent countless hours as a youngster looking at code in all sorts of languages, changing it, seeing how others write it, etc. What kept me going at an early age was the desire to create games. After I graduated from Engineering school, programming became one of my first good paying jobs and a doorway to a lot of things that I wanted to do including getting out of 9 to 5 and owning my own business. Ultimately I molded a career out of it and my ability to do that was due in no small part to the practice that I put in as a youngster.

Today I have the knowledge base to recognize all the different tasks that go into a software project and put together all the technical elements that are needed for the solution. ‘Knowing a computer language’ is about 5% of that total solution just like knowing French grammar is about 5% of what’s required to speak French. The other 95% comes from practice.