How to teach yourself how to code

Nov 2024
views

Context

Did I mention I'm self-taught? It seems to be all I talk about. Fortunately, it seems to be all I get asked about too. I wanted to put together a roadmap (constantly updated) to help others understand where to start with their journey. Let me preface it with a few things:

  1. It is hard, but not because you're not smart. It's hard because it takes time, and people are no longer patient.
  2. It requires consistency and dedication. You cannot learn this on the side after all your other commitments.
  3. My roadmap is almost certainly not the optimal way to learn. This is what worked for me, and how I'd advise others to learn.

In this guide are a lot of terms you may not know, so I've linked basic descriptions of it for you to dive into.

Below are the basic steps of the journey — This is an EXTREMELY condensed timeline, so I wouldn't recommend skipping steps because we're already skipping a ton. I've kept it very concise on purpose; I am happy to answer questions, provide clarity, or give advice if you're ever stuck. Email me at marcechaman@gmail.com.

STEP 1 — Learn Syntax

You must understand how code works. You must understand the different 'grammatical structures' or 'syntax' of code before you can rely on tools to do it for you. Thus, using resources like Codecademy, you will learn the basics of programming. Learn the following:

If you dedicate your time to this, you can learn the basics of all of these within 4.

STEP 2 — Get the tools for the job

To start your project, you need a few tools in your toolbox.

Poke around VSCode, create some files, etc. Get familiar with it, because you're going to spend a lot of time in it.

STEP 3 — Build stuff & learn stuff, simultaneously

At this stage, you should know how to program at a basic level and have the tools to build something. However, this is the steepest part of your learning curve — you are going to learn a TON. Therefore, you should be learning the right things with your limited time.

3.1 — Build a full-stack platform with a modern tech stack

Below is my suggested tech stack for your first project:

Your DevOps toolstack should be:

I'd follow this process:

  1. Write a document on what you want your app to be like. What features are you looking to implement? What are your design inspirations?
  2. Design some (rough) wireframes on Figma. Design isn't for everyone, but I think this is very important.
  3. Start coding.
  4. Run into walls. Text your friends, read documentation (!!!), and use all your resources.
  5. Break through walls.
  6. Deploy your app.

Here are some things you want to do within your app:

I strongly suggest reading documentation obsessively and looking at popular open-source code bases to see how experienced engineers write code.

GOALS:

  1. Learn how to think about your app's flows before building (in Figma, during the design phase).
    • Prevents you from having to re-write code, or re-architect your project. Fixing code is harder than fixing designs.
    • Makes you think about your features and how they work in depth, giving you clarity on what needs to be built when you code.
  2. Learn how to ask for help and use documentation/resources effectively.
  3. Learn how to get code to do what you want it to do.
    • A sub-goal here is to learn how to be clean. You should care about things down to your directory structure. Here is an example of what I think is a good directory structure.
  4. Learn to translate design to code.
  5. Get frustrated because you want your code to be better.

WARNINGS:

  1. This project will not be good. In fact, it will probably suck. Your goal is to try to achieve something cool with code, not to build the next big startup. If you don't have this patience, don't start programming.
  2. You will run into a lot of walls. You must let go of your ego and ask for help consistently.
  3. This is hard as hell.

3.2 — Learn basic Data Structures & Algorithm

Data Structures & Algorithms (DSAs) are normally used during the software engineering interview process. Your goal is not to be incredible at LeetCode, but instead, you want to learn fundamental computer science skills. I would strongly suggest doing 1 LeetCode problem a day (or more if you like it) from Neetcode's roadmap. This will help you work through logic when you're developing your full-stack app. Many problems you run into regard DSAs.

GOALS:

  1. Learn how to write efficient & effective code.
    • Focus on understanding and calculating time and space complexity for solutions.
  2. Learn fundamental CS skills.
  3. Learn to write organized and easy-to-follow code.

If you want to get REALLY into LeetCode, I have written about how to get good at it here.

3.3 — Read about what it means to write clean code

Read Clean Code — A handbook of agile software craftsmanship (Robert C. Martin Series, 2008).

GOALS:

When in doubt about anything, literally just ChatGPT it, or email me.

STEP 4 — Read about how to do things better, and do things better

Build more stuff, and build it better. Below are some things to learn about on your next project if you want to level up your programming skills.

The world is now open for you to build anything you want.

Notes

Thank you to Jamyson Gouveros for his curiosity, to Leonardo Montes-Quiliche for shamelessly asking me questions, and to the 150+ engineers I've forced into meetings while I was going through this process.

If you have any advice or suggestions for this guide, or any questions, please contact me at marcechaman@gmail.com.