Skip to content

Instantly share code, notes, and snippets.

@Riizade
Last active July 24, 2024 01:10
Show Gist options
  • Save Riizade/57d075ccaeb7063a64a4702bce89bb0c to your computer and use it in GitHub Desktop.
Save Riizade/57d075ccaeb7063a64a4702bce89bb0c to your computer and use it in GitHub Desktop.
Advice for people learning to code for the first time.

Anyone Can Code

It doesn't matter if you're bad at math. It doesn't matter if you're bad with technology. Everyone starts from a different place, but they all get where they're going eventually.

A thing I heeard a lot at university was that in the first year, there was a small difference in ability between the kids that started learning to program in middle/high school, and the kids that started with their first university course. By the end of year 4, there is no difference, the distribution of proficiency is pretty much entirely uncorrelated with where they started 4 years prior.

The point being, it doesn't matter if you never learned your multiplication tables and this is the first time you've ever touched a computer. If you stick with it, you'll figure it out.

Method and/or Madness

The first and only rule of learning pretty much anything is that it doesn't matter so much how you choose to go about learning it, it really only matters that you consistently go about learning it.

Here's a brief list of ways people have learned to code:

  • Editing games whose source code came printed in magazines for you to type into your home computer
  • From high school classes
  • Programming their TI-83/84 calculator in BASIC (to cheat, to play games in class, etc)
  • From college classes
  • Modding a game like Warcraft III, Skyrim, or World of Warcraft
  • Trying to hack into a website
  • Writing a command-line utility to solve a problem they had
  • Writing macros in Microsoft Excel, Google Sheets, or something similar
  • From online classes
  • Building a website for a business or an event
  • From a tutor
  • Online tutorial sites

There are many more. Some of these are probably more efficient than others (although it might be surprising which ones), but as long as you keep learning and practicing, you will learn to code, and you will become good at it.

The Journey

Like most things, being able to code is not an on/off switch. There's a spectrum of proficiency, and writing code encompasses lots and lots of skills, and people will have each of the subskills to varying degrees.

Some people can take a compiled program and reverse engineer it pretty quickly, and debug extremely complicated codebases, but write code that's needlessly complicated and extremely difficult to understand and debug.

Some people can write extremely readable, robust, performant code in one programming language, but then almost not at all in another.

Sometimes you might feel like you don't really know what you're doing. That's expected, it's a rare occurence to work in a language, framework, and problem domain that you've even seen before, let alone understand 100%.

When you see other people online talking about code and you feel out of your depth, remember that they might be 40-year career experts in whatever subject it is, or it might just be their specialty. Sometimes you might have a wider breadth of experience, and they really just know the one thing.

Of course, sometimes they might just be more skilled than you, and even got there in less time! That's okay too! You don't have to be the best in the world, you just have to be good enough for your goals; which for most people is getting a nice job that pays well.

The Process

Choosing a Programming Language

It doesn't really matter. Most widely-used languages work pretty much the same. If you learn one, you can probably learn any of the others in under a week.

With that said, my recommendation is this:

If you want to learn to write user interfaces for websites (usually called "frontend development"), learn JavaScript first.

For pretty much anything else, learn Python first.

Beginning to Code

Go to https://codecademy.org and follow an intro course for your chosen language. This is a great way to get introduced to programming and introduced to a specific language.

Alternatives include online courses from places like Coursera, or high-quality YouTube tutorials. Whatever works for you. Just remember to actually write code, not just learn about it in abstract, most of your proficiency will come from writing, reading, debugging, and rewriting code.

Leveling Up

Small Practice Problem Websites

There are lots of sites that offer small puzzles for you to practice your programming skills and learn new ones. Generally, you pick a problem, try to solve it, and then when you're done either because you've solved it, or gave up (which is 100% okay, don't bash your head against something you're not making progress on), you can look at other peoples' solutions to see how they did it, and hopefully learn something from it.

Here are some sites for practice. I recommend trying all of them out and finding which one you enjoy most. Again, the important thing is that you do the practice, not that the practice is as efficient as possible.

Generally a problem takes 5-20 minutes. Really great for practicing concrete skills in the beginning of your journey.

These problems generally take 20-60 minutes, and they're the style of problem that high-paying companies like Google and Amazon will give you during an interview. If you can solve the problems ranked "hard" in about 45 minutes without hints, you're ready to pass a Google/Amazon interview.

Keep in mind that the goal for problems on these sites is to write the code in a theoretically optimal way. For more on tackling these sites, see my advice on interviewing for a tech job here.

Another type of practice website is https://exercism.org. This site has you complete a (very) small project, typically between 5 and 60 minutes long. Then, you can upload your code, and actual human people who know the programming language you're writing in will comment on your code and give feedback on how to make it more readable, faster, cleaner, less confusing, etc. This is very similar to how code review happens at many tech jobs, where your coworkers will review your code before it gets shipped to the customers, but the feedback on Exercism is typically much more thorough than your coworkers would be, since they're there to teach you about programming, not just to make sure things won't explode.

Other Practice Sites/Apps

There are many other websites and applications for practicing programming. Some are like the sites above. Some allow you to use programming to play a game (CodeCombat, an RPG; Screeps, an RTS come to mind). Some help you practice specific skills, like exploiting vulnerabilities in websites or disassembling compiled code.

It might be a good idea to try some searching and take a look at what's out there.

Writing Your Own Projects

This is a broad category of activity. Really, you can do anything here, and I don't have a lot of advice for choosing a project. Just know that if you do think there's something you can use code for, do it! Don't wait until you've "mastered" the skill or whatever, just jump in. The first version will be garbage, but that's true of software written by extremely competent professionals, too. It's not uncommon to write something once, throw it away, and write it a second time now that you have a much better understanding of the problem and the project.

You don't have to finish the project for it to be valuable, it'll be great practice even if it never does anything useful.

Here are some (very) vague ideas on what you might want to build.

  • Automate a part of your day job
  • Write a command-line application to solve a problem you have
  • Build a website

Do NOT try to build a massively multiplayer online game. That's probably the only project I'd say is a bad first project. Building a Twitter clone? sure. Facebook? sure. WhatsApp? sure. Single-player game? Pretty difficult, but sure.

Some projects might be hard, but they are achievable. An MMO might take years just to be able to have two cubes that can move around in the same world. The cubes will be ugly, and they won't even move correctly.

Work Experience

Working at a company doing software programming is a great way to practice and improve your coding skills. However, getting the job might be the hard part if you're early on in your journey.

Getting a Job

See my advice here.

Other Advice for Programmers

See a compilation of my other advice here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment