How to start learning how to code by yourself

Mario Hayashi
8 min readApr 8, 2022

--

I’ve been asked a few times about how to get started with coding and how to learn by self-teaching. So I decided to write this post and base it on my experiences of 14+ years of coding. In it I’ll cover:

  • How I got started
  • Why should I get started?
  • Is it too late to start?
  • Where should I start?
  • What can I do to keep improving?
  • What can I do to stay motivated?

I won’t get into how you can find software jobs, as that’s a little outside the scope of this post. But hopefully this post will get you excited about coding and get you to take your first steps towards learning a lifelong skill.

🌅 How I got started

Many years ago, I learned how to code by hacking together a Microsoft Excel file with VBA macros that automated calculations in the spreadsheet and update colours of cells. I had no degree and had never coded before. A lot of it was just driven by curiosity: how does this work and how do I put these things together? That kept me interested as I self-taught myself to code with Microsoft’s Excel manual. Of course, I’ve since come a long way since those days and have learned to program formally at university (computer science) but a lot of my coding knowledge — by which I mean a LOT! — has come from coding on the job as a product engineer.

Programming is a lot like playing Lego. I need a 4x4 piece… can I use two 2x2 pieces? After putting together all the blocks, you have your Lego house. Programming obviously goes a little deeper than that but, in essence, you’re creating and re-using blocks of code to help you build a system that does (hopefully!) something useful.

❓Why should I get started?

Good question! You don’t have to. A lot of people don’t and are perfectly happy not needing or wanting to code. But you may want to learn it for fun. Or you may need it for your studies at university. You might want to progress your career. You may even want to change career. Here are some benefits to learning to code:

  • Interesting jobs emerge if you know enough coding to be dangerous (e.g. data analyst, etc.)
  • Exciting jobs emerge when you get really good at it (e.g. software engineer, data engineer, etc.)
  • Good pay is probably a corollary. In 2021, the global median salary for a full-stack engineer was $56k. In the US, the same role had a median salary of $120k [*].
  • It’s a transferrable skill, you can take it with you to a different country. Most software jobs are remote as well
  • Fun! Coding can be an enabler and allow you to create interesting projects. I like making things and have projects on the go all the time.

😱 Is it too late to start?

Some may be asking whether it’s too late to start — I say certainly not! I didn’t learn until I was done with high school. I self-taught myself before learning it formally at university where almost all of my classmates already had years of experience coding. I was intimidated by that but, with curiosity and tenacity, I managed to keep up with my classmates and really enjoy the learning process. I still keep learning today. Here are reasons why it’s not too late:

  • Curiosity is all you need. If you’re actually interested in learning how to code and it excites you, it’s never too late to start.
  • Most people don’t know how to code. So learning some amount will put you ahead of the curve very quickly.
  • There are more jobs than there are people. There are many startups that get created every year. More recent companies will have a tech focus and be hiring for technical roles. Existing companies need more technical folks to keep innovating. As a software engineer, it’s not unusual to get recruiters reaching out to you with job roles a few times every week.
  • You can pick your own niche. There are so many areas within programming and coding. There are lots of niches where there aren’t many developers and you can become one. You could for example become a Wordpress developer or Low-Code developer

🚀 Where should I start today?

For the sake of this blogpost, let’s assume you’re building a web application or website and stick with the most popular language (see developer survey): JavaScript. By language we mean programming language. In development, we often talk about front-end development to describe coding for the user interface and back-end development to describe coding the server. For the front-end we’ll use React.js — the most popular front-end web framework by far — and for the back-end we’ll use the Node runtime and a back-end framework called Koa.js. In short, Node is the program that runs JavaScript for you, as the programming language doesn’t run by itself. Koa.js is the server program written in JavaScript that runs on Node… I hope that makes sense!

Where do we start with JavaScript, React.js, Node and Koa.js? The best method — in my opinion — is to get your hands dirty and start writing code as soon as you can. Luckily for us, there’s a tonne of resources out there to help us. In the resources below, you’ll find that HTML/CSS are used too. Don’t worry too much if you’re not familiar with HTML and CSS and try to follow the tutorials as much as you can. Without further ado, here is a list resources that can help you towards learning JavaScript and Node:

Get your first program (”Hello World”) running in your browser

  • javascript.info includes a tonne of good material for learning JavaScript in general

Get started with React.js, a JavaScript “framework” or tool to help you code a web application (i.e. a website)

Write your first back-end server program with Koa.js

The tutorials above will walk you through the basics of front-end (JavaScript, React) and back-end development (Node, Koa). Why do we want to do front-end and back-end development? Because once you get proficient at writing JavaScript and using the frameworks, you can create a front-end that communicates with the back-end. This is the most important (beginner) concept to understand in the web — the Client-Server model:

  • Very simply put, the front-end is the client and back-end is the server
  • The client is often the user’s browser. This is where we have our JavaScript/React.js program run
  • The server is the back-end. This is where our Node/Koa.js program runs

When we have our front-end communicate with the back-end, a lot of things can happen:

  • The client can ask the server for data
  • The server can get something from the database and send it to the client
  • And so on

The point is of all this is that once you start learning a bit of JavaScript, a bit of React.js and a bit of Koa.js, you’ll learn more and more about how the web works and it’ll be a springboard for learning more about coding!

🏃What can I do to keep improving?

Programming and software development is a continuous learning activity. It’s not something that you’ll cover in one classroom lesson and be done with. Software has massively evolved since the early days and continues to evolve today.

There are loads of resources out there to teach yourself programming. As with all other things however, Reddit is a great place to start: see this post in /r/programming. It lists:

  • Great sites and apps where you can learn for free
  • Resources for gamified learning
  • YouTube channels to keep you engaged

What you want to do to stay ahead of the curve is to keep learning and trying new things. Build fun things to internalise your learnings and apply them at your work. Here are some concrete suggestions to help you continue to learn:

Learn your programming language really, really well. This will help you code at lightning speed and make the program to what you want it to do

  • Read books (e.g. JavaScript: The Good Parts), online documentation (e.g. MDN docs) to help you understand the language
  • When you’re comfortable with your programming language, move onto another one (e.g. Python). You’ll notice that each language is slightly different and used for different purposes

Learn your web frameworks well. Learn about its add-ons and libraries. You’ll notice that a lot of good code has already been written and you don’t need to re-invent (every) wheel

  • Read documentation (e.g. React.js docs)
  • Learn about add-ons and libraries in the ecosystem (e.g. React.js ecosystem)
  • Join meetups (e.g. React.js meetups), learn from other people
  • Take courses and watch tutorial videos
  • Make web applications in your spare time!

When you feel comfortable in programming and web frameworks, you can consider more options:

  • Get a software developer job. Sometimes the best way to learn is on the job!
  • Go to a code bootcamp. Please be careful however with bootcamps that purport to do many things (offer you an amazing job at the end, etc.) but who actually don’t
  • Study JavaScript, Python and programming online with courses in Udemy or The Odin Project
  • Learn it at an academic level — study computer science or similar. There are also courses such as Harvard’s CS50: Introduction to Computer Science as well as Mooc by University of Helsinki

🔥What can I do to stay motivated?

Learning to code can be a daunting task and can feel quite challenging. There’s no easy way to learning to code other than exercising and honing your skill, just like any other skill. Sometimes the going can get a bit tough but here are a few tricks to keep you motivated:

When you’re stuck:

  • Talk to someone. Often the act of saying it out loud helps (see Rubber Duck Debugging)
  • Sleep on it. There are many times when I woke up and knew the solution to a problem I had the night before
  • Go to a museum or do something unusual to break away from the roadblock. Sometimes you’ll come back with a new idea

When you’re feeling lonely while self-teaching:

  • Talk to someone. There are many forums out there for coding (e.g. dev.to, Slack, Reddit, etc.)
  • Go to a meetup, meet new people

When you’re feeling deflated:

  • Try a new programming language, learn a new framework
  • Read a book. Knowledge doesn’t always need to come from practice

🙌 Conclusion

There are many ways to get started with coding! I’ve only touched the surface of the discipline. Hopefully this post has helped you get a picture of where you can start and make your first steps towards learning a great skill.

--

--

Mario Hayashi

Product engineer, No-Coder, contractor, tech leadership at startups, indie maker.