DEV Community

Cover image for How do you start learning how to code?
Noah Wright
Noah Wright

Posted on • Originally published at noahwright.dev

How do you start learning how to code?

TL;DR:

  • Get started. Taking that first step and doing anything is more important than having a perfect plan.
  • Find something you want to make. This will keep you motivated to keep going.
  • Tackle your project in tiny little chunks and don't get hung up on what's going on under the hood.

"How did you get into programming? Where should I start? What's the best way to learn?"

I get these questions all the time. For a long time, I didn't have a great answer. I got started roughly 20 years ago - not only do I not remember exactly how it went, a lot has changed since then. Since people keep asking, I took some time to write out some advice for those who are trying to get into programming.

Get started!

Many of the people who ask me about this are trying to figure out how to get started with programming, but haven't actually started. They looked up resources and couldn't decide which one to use, so they stalled out. I get it - there are a TON of resources out there. It's hard to choose - so don't! Use the first learning resource you can find. Stick with it for a little while and if you really hate it, switch to something else. Just because you start off watching some person's YouTube channel doesn't mean that has to be your only learning resource. You can use them all!

But what language do I use!?

Okay, so this is one area where you do need to make a decision. When you're first starting out, you'll want to stick with one language and not hop around constantly. Which language you work with will depend heavily on what you are trying to do. Below, I'll talk about the importance of having a passion project. Knowing what that project is will help you decide what language to learn. For example:

  • Do you want to make websites? You should probably learn JavaScript, HTML, CSS - you know, web stuff!
  • Are you going to make projects with a Raspberry Pi? Project tutorials you find will likely use Python.
  • Will you make a Windows desktop app? Something like C# will let you do this pretty easily.
  • What if you want to make phone apps? Android apps are written in Java and Kotlin. iPhone apps are written in Swift.

Once you pick a project, look up similar projects and find out what language(s) they use. The goal here is to make sure that there are plenty of resources for you to use. Can you write a web app with C#? Yeah, but you're going to find a lot more information for web programming in JavaScript than you will for C#. Make things easy for yourself by using the language that has the most tutorials / documentation for the thing you want to do.

Now for the real question: what project are you going to do?

Find a passion project

I got into programming because I loved video games. Not only did I find them fun and engaging, I was fascinated with how they were made. I always wanted to make my own, so I've been tinkering with game design for as long as I can remember. Game programming is not easy - it's honestly not a very good place to start learning code at all - but because it was something I was passionate about, I kept going no matter how tough it got.

You need to find your own passion project. It can be almost anything, but it should ideally have a few qualities:

  • The project can start small and scale up. For example: make a personal website At first, it can literally be one page of static content. From there, you can keep adding pages and functionality until you've built something more advanced.
  • The hard problems are already solved. Everything you need to do for the project should be Google-able. My early game design projects were clones of simple games (i.e.: stuff like Pong and Galaga) that I then expanded upon. This gave me plenty of learning resources to lean on.
  • You'll actually use it. This is probably the most important thing - if you aren't excited about using the finished product, you won't be as motivated to work on it. It needs to fulfill a need you have or solve a problem you can't find existing solutions to.

Almost every programmer I know of has little side projects. They couldn't find a tool to do a thing they wanted to do, so they made their own. Existing solutions frustrated them, so they made something that worked for them. Sometimes, these tools expand into actual products - like how Slack started as an internal tool for a game company - but often they are strange little things that are only useful to the person who made it, and that's totally fine! The important part is that YOU want to make the thing you're making.

Stay down to Earth

Years ago, I started telling people that programming is like magic. Harry Potter and I do the same thing - we recite some words in the correct sequence and magic happens. I don't know how it all works, and the students at Hogwarts have no idea how their magic happens - we just know what words to say! Students who I have told this to say it makes it easier to learn to code.

Why? Because many programming students fall into the same trap: we want to know how it all works. Many of us are quick to dive deep and find out what makes things tick, but it quickly turns into a "can't see the forest for the trees" situation. When working on your project, you need to step back and look at the big picture. If you're not sure where to start in creating your app or building your website, follow these steps:

1) Forget about code and describe - in plain English sentences - what your program needs to do. Write down what the user will do and what you expect to happen in response. Once more, with emphasis: you aren't thinking in technical terms at this point.
2) Break your steps into many, smaller steps - still as plain English. Instead of "the user logs in" you want something like "user clicks 'log in' link. Login form loads. User types in username and password. System validates password. Home page is loaded with user info in the corner." The more you break it down, the easier step 3 becomes.
3) Now we think about code! Solve each step you created above like its own tiny programming challenge. Instead of having one big, daunting task, now you have a bunch of small, manageable tasks.

This is a great workflow for a few reasons. Number one, if you ever work professionally as a programmer this is how work gets defined and divided up. Secondly, there is the psychology effect. If you only look at the peak of the mountain you're climbing, it can feel overwhelming, like you'll never climb that far. Instead, you want to focus on getting to your next stopping point, your next handhold - whatever gets you one tiny step closer to the top. As you complete each task, you can have the satisfying experience of scratching it off of your to-do list. This will motivate you to keep going, and you'll end up getting a ton more accomplished.

Summary

When I learned to program, there were so few resources. Now there are so many freely available tutorials, videos, tools, and people willing to help you get into software development. There's no need to wait around until you can take a programming class or attend a bootcamp - you can start teaching yourself right now. If you have even a faint interest in programming, I highly suggest you go out there, pick a project, and start working on it!

Top comments (0)