The Best Way to Learn How to Code (Zero to Hero)

Mazn Adnan Shkoor
The Startup
Published in
7 min readJul 16, 2019

I remember when first I started coding, I was really frustrated. I got to the point where I did not know what to do to improve and get to the level where I could start building applications. For countless days, I was contemplating of me building a real application. When I started learning something new, I wanted to implement it immediately. However, I failed miserably. I did not know what I was missing. Do I have to learn a new language? What programming language should I learn first? How do I learn all programming concepts and framework jargon that are used frequently? I was utterly lost, but I have never given up on trying. Unfortunately, it took me a long time running and coming back to the same spot, which now I call it the “black spot.”

Most people are new to programming, and they suffer from the inability to get away from the black spot. In other words, they want to get out of learning phase as soon as possible so that they start building real applications. Sadly, many people get stuck in the learning phase when they keep watching online tutorials, searching online, or probably even reading books. Once they finish their online courses, they would feel good! They might tell themselves, “let’s start coding!” Again, they get stuck somewhere because they are missing some fundamentals. Obviously, any available online course, any book out there, or any online website cannot cover everything for you. You might want to achieve something that you may not have come across in the learning phase. That’s where most people get disappointed and start doubting themselves. Unfortunately, I have seen people giving up on coding completely!

I was there too! I doubted myself! But I have never given up. I kept continuing because I knew I was there, but I was missing something! I had to know what I was missing!

So, is there a better way to learn how to code?

For countless days, I was literally obsessed with finding an answer to that question. What is the best approach to learning to code? Although the question seems so simple, and the answer to how to learn to code is so misleading.

I have asked and searched that question probably a million times. I have found so many answers. Someone told me start building real applications, some say start taking online courses, and other say start reading programming books and start practising.

But you know what is really frustrating about those responses? They all are great answers.

Learning how to code becomes easy when it is done in a particular order. When you try to learn to code randomly without sequence, you will get lost and bored. It is like learning a new language without learning the letters (alphabet) first. It is like learning how to bike without training wheels.

So, the best way to learn programming and getting away from the black spot is to break it down into four separate steps. Think of these steps as a ladder. You need to climb the ladder step by step. You cannot jump from the first step to the last step.

· Learn programming fundamentals.

· Learn how to solve problems.

· Build simple projects.

· Learn programming best practices.

Let’s take a look at each step in greater detail!

Learn Programming Fundamentals

In this step, most people get stuck learning syntax, which will quickly disappear when they move to problem-solving. It is the realm of countless introductory books, videos, and courses. A lot of money is made in this step because most people learn a bit of syntax and never go any further with it.

Obviously, at this step, you should learn the syntax. But, you should learn the fundamentals as well. You need to know the basics and not immerse yourself with every little syntax at this step. Do not get caught in the common trap of continuously learning and relearning the syntax. You only need to understand the basics truly. It does not matter what programming language you are learning as long as you know the basics such as variables, array, loops, if/else statements, functions, and so on. Once you have mastered these basics, then move on to some more significant concepts such as object-oriented programming.

At this point, YOU NEED TO STOP! Do not stay at this step for any longer!

Learn How to Solve Problems

Now, this step needs a lot of attention and dedication. People almost entirely ignore it. That is why only most people don’t get past learning syntax. They have no clue other than a vague idea of how to build things, which is like trying to write in a foreign language without learning the letters. Yes, it is possible to code some stuff, but it is far from an idea of a way to learn.

When you can take the syntax and fundamentals from the first step and apply it without being told what to do, you are in the solving problem step. This is the core of “thinking like a programmer,” which is by far the most challenging and most crucial part on your journey to get away from the black spot.

So, how to improve and learn to solve problems?

There are four steps that I follow whenever I am trying to solve a problem.

1. Understand the problem

Read the problem and start thinking about it. If possible, write the things that are given and the things that you need to find out on a piece of paper.

Ask yourself these questions

· Do I really understand the question entirely?

· Can I explain the question to someone else?

· How many inputs are required?

· What would be the output of the provided inputs?

· Do I need more information? If yes, then understand the question again!

2. Go through sample inputs

Going through some sample inputs and coming up with more examples sure helps you a lot to understand the problem well. It gives you a clear way to how many cases your code should handle and what are the possible output range.

Here is what I suggest

· Take a simple example and see the output

· Take a more complex and more significant example and see the output

· Try out a problem without input

· Try out a problem with invalid input

3. Break down the problem

If the problem that you are trying to solve is enormous to handle, then I suggest you is to break it down into manageable chunks.

· Try to make a flow chart for the problem

· Divide the problem into small chunks

· Try to make independent functions for each sub-problem

· Connect those sub-problems by calling them in the required order

4. Start solving the problem

Now, you understand the problem and its time to write the code. If you can’t solve the problem fully at once, try writing code for a simpler subpart, as you solve the problem, gradually you keep figuring out the problem out in more detail, and you start getting new ideas.

Build simple projects

Once you reached this step, it is time to pick an idea to build. Start simple! Yes, even if you are thinking to build the next Facebook, but instead you should be thinking about how to build small projects that can help you to put all your skills into this one simple project.

Based on your interest, come up with an idea for a simple application that will do something neat. It does not matter if the application already exists. In fact, it may help you if the project already exists.

Here are some projects to start with

· Build your own calculator

· Create a To-Do List app

· Develop a weigh conversion tool

· Build yourself a portfolio website

Learn programming best practices

Once you feel comfortable building some neat applications, it is time to improve the quality of your code by following programming best practices. Always try to keep up with the community and learn some good practices.

Here are some programming best practices

· Use consistent indentation

· Do not repeat yourself

· Avoid deep nesting

· Limit line length

· Manage file and folder structure

· Follow naming conventions

· Keep the coding simple

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Thank you for reading this far! Sorry if the article was a bit too long! If you enjoyed the article, please share, comment, and clap 👏 few times for me! Your support will definitely motivate me to produce great content!

--

--

Mazn Adnan Shkoor
The Startup

I am a passionate web developer, a blockchain technology enthusiast, and I have MSc in network engineering..