How to learn to code

Raghav Arora

Sep 19, 2019

I often talk to people towards the end of their degree who wished to have learned to code in their early years of college.

They complain that they didn’t know that it was important for their career. They did not begin early enough and now with only a few months left to graduate, there isn’t enough time. The usual story is one of these -

  • They found programming to be difficult and treated it as one of those one-off required-to-graduate subjects.

  • They wanted to take up management roles or that CS was only a minor part of their course, and therefore they didn’t bother beyond getting a sufficient grade.

In both cases, it comes down to not knowing the importance of programming. If you have not been exposed to the tech industry, chances are that you don’t know the benefits and downsides of knowing or not knowing how to code.

Fact

The demand for developers is high in the job market, and this demand is only projected to increase for the foreseeable future. According to the US Bureau of Labor Statistics, the demand for software developers will increase by 24% between 2016 to 2026, which is more than 3 times the national average. Other countries show similar projections.

It is because technology is, in fact, eating the world. It is not just a fancy quote. A new company in any industry will either be tech-first or use software to automate most of their processes. Amazon, Uber, Ola, Netflix, AirBnB, OYO, Instacart, Swiggy and MakeMyTrip are all examples of tech-first companies that belong to different industries, but extensively use technology to serve their customers and thereby employ thousands of software developers. Being a programmer gives you the option to work in any industry you like, and thus offers a variety of career paths.

The problem with colleges

Students often complain they didn’t know how to write meaningful code. Colleges tend to spend a lot of time on theoretical aspects of programming. Whatever little time is left for practical exposure is spent in a sandbox of abstractions for instance, write a program to check if a number is a palindrome and write a program to print a pattern on the screen. It’s like trying to learn to swim without stepping into the water.

If you find yourself in this situation, your best bet is to take control of your learning trajectory. It is never too late to start.

Starting out

Before you have even started, you encounter your first roadblock — the choice of language. You get bombarded with hundreds of options and can’t figure out which language to start with.

Programming concepts are identical and the choice of language is inconsequential. It does not matter how you start. Python and Ruby are considered easy for beginners, but it doesn’t really matter. Choose any language you think would be convenient for you (maybe you enrolled in a programming class and already have some background on one)

Start with the recommended book for that language. Make sure it focuses on practical application of the language and has a lot of examples. A good way to begin is to take existing code and modify it to do something new.

As you work your way through the book, start planning a project you want to build with it. Ideally the project should solve a problem in your daily life. As a kid, Zuckerberg built a system which connected the computer at his home and the ones at his father’s clinic so they could send messages to each other. It was a simple problem with a simple solution, and a perfect way to practice and fine-tune his skills.

You don’t need to worry about your bugs in your programs, or even not understanding bits of the code. That is a part of the process and you’ll get better with time. The end game is to reach a point where you are solving problems, while the language you use and the code you write are just means to an end.

Why build projects?

Building a usable project and shipping it simulates real-world applications of programming in the closest way we can think of.

In a real world scenario, we often do not know the exact problem we are trying to solve. Sure, a good programmer can write code for balancing a binary tree, but an excellent one figures out that the solution to the problem is to balance the tree. When you build projects to ship, not only do you need to solve multiple problems, but also define and redefine them as you work through them.

“With complex, ill-defined problems, you’re better off writing a prototype as fast as you can, seeing what turns out to be wrong with it, and then changing your definition of the problem accordingly”

— Paul Graham

In addition to improving your problem solving skills, working on projects exposes you to a wide range of technology — databases, networking, file handling, server gateways, containers, etc. A simple note taking app is built by stitching together a user interface, a database and a file handling system using logic written in a programming language. The learning potential is massive and the journey is exciting.

Branching out

Programming languages dictate how you think about programs, so it is hard even to conceive of a language more powerful than whatever you’re used to.”

— Paul Graham

As you continue your learning journey, branching out is important. Even though programming concepts are identical, every language has its own architecture, patterns and characteristics. When you use a language for long enough, you start to think in it. As a result, you cannot think beyond the capabilities of the one language you know. It is essential that you do not limit yourself to a single set of skills and explore as much as you can.

For many applications, your choice of tools is going to be limited. You can only build a powerful iOS application in Objective C or Swift. You need to know Solidity to create smart contracts on Ethereum and Python is emerging as the most important language for machine learning applications. Therefore, it is good to have a little bit of experience with a wide set of technology. You want to be the person who can learn new technology within days and get to work. Remember that the goal is to solve a problem and tools you use are the means to an end.

To conclude, learning to code gives you the power to create, and the way to learn to code is to start creating. You need to start somewhere and work your way up. If you feel stuck, don’t be afraid to reach out. I will help you to the best of my ability.

If you enjoyed reading this, please share it with your friends and help them out to understand why it’s important to learn to code and how they can get started.