Skills like coding scare many people. The media has made it seem like writing code is a genius-level activity, as weird symbols race across the screen and techno music blares in the background.
But coding is actually pretty easy.
I’m not saying this to dismiss the work of brilliant programmers. A skill can simultaneously be fairly easy to get the basics in, while also being really difficult to master. Everyone learns to write, few people learn to write well. There’s no contradiction, therefore, in saying that basic literacy is an “easy” skill to gain (in that the vast majority of us can do it), without dismissing the efforts of talented writers.
Nor am I saying this to mock people who are trying to learn to program and find it frustrating.
Rather, I say coding is easy because I believe that almost all people, even if they don’t see themselves as particularly smart, can learn to write simple programs. That they don’t be mostly because of some structural barriers than any intrinsic difficulty with the skill itself.
I started learning how to write code when I was 14. I’ve read a couple of O'Reilly books on programming, took even free courses on Coursera and Udemy. Watch thousands of hours on programming-related videos on YouTube. I remember even working through the content of a Computer Science Degree online (which is totally unnecessary if you want to learn to code, by the way).
If you inspect, in some ways... my background may seem to disqualify me about making statements on the ease of coding. However, I can say without a single doubt, that subjects like Accounting, Physics, Engineering and even Law are more difficult than programming.
Most math you learn in high school is more difficult too, believe it; although you usually get wayyyyy more practice with algebra than writing code, which leads to a misperception which is more difficult.
Learning to code is hard for a couple of reasons:
Installing new languages can be super frustrating. This is the first activity for a wanna-be programmer. This can create the misperception that programming is really hard because newbies extrapolate the difficulty of getting set up to how it will be every moment after.
Also, there are waayyyyyyyy too many languages, frameworks tools, libraries and plug-ins. Starting programming is super overwhelming because there are a stadezillion things to learn and you do not know where to start.
The first moments of programming are the hardest. Getting set up is annoyingly difficult and often requires learning a new way of working with computers even before you write a single line of code.
Consider the instructions for installing most languages:
“Open the terminal or command prompt. Type in a case-sensitive, exact set of instructions to download and install the language. Use GitHub. Homebrew. Versions matter too. Are you running 32 or 64 bit? ‘Cause if you’re not sure, it will crash with a cryptic error message and you’ll feel like an idiot.”
These tools are learnable, like everything else, but they reinforce the impression given by the media that coding is mostly using elite tools with weird, unfriendly user interfaces. When people see coding, they imagine parsing the green-streaming letters on computer screens like the movie, The Matrix; whereas the truth is a lot more like following a recipe along with step-by-step.
There are a few ways you can do this. My favourite is to just go to the language or technology official documentation, which will tell you exactly how to set up step-by-step.
Alternatively, you can dive into internet tutorials (why do you think platforms like YouTube, Quora exists?), but recognize that sometimes they are aimed at already-proficient programmers, who know what OOP and GitHub are, and are fluent with writing commands into Terminal.
If you get one of these, you can try to follow it, but don’t feel bad if you screw it up. It’s frustrating, and it doesn’t mean all coding will be like this.
Another option is to avoid setup at all. Just use some coding tutorial website that teaches you to code with no installation. I like this too, but sometimes you can’t actually build the thing you want to build with these apps. However, if you hate the setup, that’s where I’d start.
Most important, however, is to remember that I told you this. When you try to learn to code, it will frustrate you to get things running, and just accept that this is a small price to pay. Soon it will be easier and you’ll do stuff that is cool. Don’t feel dumb because you get stuck here. I still do and I’ve been writing code for years.
This seems like a good question to ask, but, I’d argue, it’s actually the wrong way to think about learning to program.
First, although programmers often boast about how many languages they know, recognize that most languages are only superficially different. Yes, I know all about language design, so don’t tell me about scripting versus compiling, or whether a language is strongly or weakly typed. Those things matter, but they’re details.
The basics of nearly all languages and tools are the same. Variables. Loops. Functions. Pointers. Data Types. OOP. Modules. These concepts exist in almost all programming languages. If you pick a mainstream language, you’ll learn these in mostly the same way, so it doesn’t matter if you pick Python, JavaScript, C++, Java or even PHP.
The place languages do matter is what you want to use them for.
Want to write iPhone apps? Swift or Objective-C are the languages of choice. Need to create web pages? JavaScript is going to come in handy. Yes, you can use almost any language for any task if you tinker with it and get the right plug-ins. However, some languages are easier to get started with certain types of projects than others.
Therefore, the first question to ask is not: which language should I learn, but which project should I start with?
I recommend starting your programming adventure, even before you write a single line of code, with a decision about a concrete programming project you’d like to create.
This serves a couple of purposes:
It narrows down the language/framework choices considerably. Once you know you’re building a website, you’re already leaning towards tools that were designed with that goal in mind.
Everything you learn is connected to a destination. Transfer of learning is notoriously difficult. Learning directly by building works better than learning something and just hoping it will help you later.
You can work on something you think is cool. If you think it would be cool to make an interactive website, do that. If you’d prefer a game, do that. If you’d prefer to automate some tedious work, do that instead. Do what you feel is cool and you’ll be motivated to stick to it.
Smaller is better in projects. Deciding to start with making the next Google is ambitious, but probably will get you stuck in the weeds before you make much progress.
If your true ambition is huge, it’s often best to work on a toy project first. Many experienced programmers still do this when they are entering a new territory of programming. Toy projects take the essential ideas of programming, but turn it into something you can do in a few days or weeks, instead of years.
Examples of good projects include:
Programs are easier when they involve no multimedia content (websites are a bit of an exception), so if you’re making a game, for instance, a text game is easier than one with graphics, if only because making all the graphics can take time.
Similarly, different core activities have different difficulties. Arithmetic and simple calculations that are done repeatedly are the easiest. It is more difficult to process text for exact patterns. Processing text for vague patterns is harder still. Processing, speech, photos and video is even harder.
If you do end up picking an initial project that turns out to be super difficult, it’s okay to scale back. “Make an application that calculates my mortgage payments” is much, much easier than “Make an application that can tell you what someone’s hairstyle is from a photo.” It’s often not obvious that this is the case, in the beginning, so don’t worry if you accidentally pick a “hard” problem to start with. You can adjust it later to something easier.
Once you’ve picked a project, the next step is to get some resources to help. This is a step many people worry over endlessly, but as the language choice, it’s a lot less important (and depends more on your goals) than you think.
I won’t list specific resources, because there are so many good ones that my suggestions are going to leave out some of the best. Instead, here are three strategies for finding excellent resources:
Get a book that teaches you the language + project you want. Coding, is it really easy? Be a computer section in your city’s bookstore or library, you can just pick any of those. I personally like O’Reilly (they publish the best software development books), but there are lots of good ones. (If you haven’t figured out which language yet, just DuckDuckGo your type of project and look for suggestions.) I read the Self-taught programmer by Cory Altoff, the first time I wanted to learn Python.
Attend a MOOC. Coursera, edX, MIT, Harvard, FreeCodeCamp and others all teach computer programming online. Once again, the thing that matters most isn’t the exact class, but whether it teaches the language/project domain you care about.
Stressing over which book or course to pick is the wrong thing to worry about. The main thing to do is to use the book or course to learn enough to tinker on your project, not to master programming on its own. Starting your project before you're ready is definitely the way you should feel about it.
Once you actually get started writing code, you’re going to encounter many, many situations where you either don’t know how to do something, or you learned how to do it before and you’ve forgotten.
In these situations, you should do what real programmers do: ask DuckDuckGo/Google/StackOverflow. This isn’t a shameful activity, but a part of real programming. I’ve been coding for years, but I always forget silly syntactical things and so I find myself duckduckgoing regular expressions over and over again. It’s not bad, it’s just part of the process.
Once you’ve gotten yourself installed, you’ve learned a bit with your book to know the basics and have started working on your first project, you’ll learn the rest by googling and adding to your library of programming knowledge. Computer science theories, detailed understandings of the language you’re working with or advanced design patterns can wait until you’ve finished a few real projects and feel like you can code something.
Notice #1: Don’t Copy-and-Paste
The first piece of advice when it comes to this step is to never copy-and-paste. Copy-and-pasting is bad because you don’t try to understand the code you’re copying. If you have to transcribe, in contrast, you naturally ask yourself, “why this? why not something else?” Even if you don’t have a great answer immediately, typing things for yourself will open your mind up to the answer whereas copy-and-pasting shuts down thinking.
Notice #2: Try it Yourself Before Looking for a Solution
The second piece of advice is to always try to solve something yourself before looking up how someone else does it. Most problems have many, many ways they can be solved. The challenge is that expert programmers often know a particularly concise, clever way, but that often isn’t the “obvious” way.
This can lead to a trap where you see a clever solution that employs tricky syntax, think that there was no way you would have guessed that solution, and believe you couldn’t have solved it on your own. That’s usually not true, yet it’s an unfortunate side effect of looking up solutions before trying to find your own.
This has been a long post, so let me reiterate the last points before I go:
Learning to code is much easier than most non-coders think, at least to make simple stuff.
The main reason it seems hard is that:
Setting up is frustrating.
There are too many options to start.
Early classes are populated with self-taught whiz-kids who make you feel dumb.
To teach yourself, you should:
If you can get through the initial frustration and build a little confidence, anyone can learn to code. Also, it’s a skill you can use throughout your life, even if you never become a full-time programmer.