How to Memorize Programming Languages

5-minute read • Updated on

I’ve spent more than 10 years organizing a computer programming meetup group and watching people as they learn how to code. I’ve observed a few interesting things during that time.

General Tips on Learning How to Code

I’ll write a few general tips about learning how to code before mentioning memory techniques.

1. Don’t Do Too Many Tutorials or Courses

“Tutorial hell” is real.

The fastest learners I’ve seen don’t endlessly do tutorials and courses. They do one or two tutorials or courses as quickly as possible, and then go off and build a lot of projects on their own.

A tutorial or course is a way to learn the basics, but it’s like doing paint-by-numbers. The real learning doesn’t happen until you go off to paint many pictures on your own, without a guide. You can ask questions and search for help while painting your own pictures, but to become a good artist, you have to paint from scratch regularly.

It’s the same with programming. You have to write programs regularly in order to become good at programming. You will become good at whatever you practice, so be sure that you are practicing the thing that you want to become good at.

2. Learn Concepts Not Syntax

You don’t need to memorize every bit of syntax in a programming language. Syntax is easy to look up. Tools like Github Copilot can even auto-complete the syntax a lot of the time. After you write a few programs in a language, the syntax will also start to embed in your muscle memory.

It’s more important to understand the concepts behind the syntax.

Here’s a simple concept — every major programming language has a way to print text. It can look different, but the main concept is that you have a way to print output.

Here are examples from a few languages:

console.log("hello world");
print("hello world")
println!("hello world");
puts "hello world"
IO.puts("hello world")

Another concept is loops.

for (let i = 0; i < 10; i++) {
  console.log(i);
}
for i in range(10):
    print(i)

The syntax there is different, but when you’re writing the program, you only need to remember “here is where I can use a loop.” As you learn different kinds of loops, pay attention to the concepts:

  • Some loops use a counter.
  • Some loops iterate over a collection of things, running once for each thing in that collection.
  • Some loops run until a condition is met.
  • Some loops run forever.
  • There are types of iteration that uses various kinds of recursion.
  • Sometimes you want to break out of a loop early.
  • Sometimes you want to skip to the next iteration of a loop.
  • Etc.

Understanding those kinds of things is more important than remembering where the colons or semicolons go.


Another widespread concept in the idea of key-value pairs. They can be called different things in different languages, but the general concept is the similar.

Here are examples of representing a goblin monster with 10 hit points in a few programming languages. Notice that the syntax is different, but the concept of key-value pairs is the same, and if you at least know that part, you can look up the syntax when you are working on that specific language.

(Note that the data structures below function differently in each language, but the concept of having ways to represent key-value pairs exists.)

// javascript object
const monster = {
  species: "goblin",
  hitPoints: 10,
};
# python dictionary
monster = {
    "species": "goblin",
    "hit_points": 10
}
// rust struct
struct Monster {
    species: String,
    hit_points: i16,
}

let monster = Monster { species: "goblin".to_string(), hit_points: 10 };
// php associative array
$monster = [
    "species" => "goblin",
    "hit_points" => 10
];
% erlang map
Monster = #{species => "goblin", hit_points => 10}.

This becomes clearer as you start to work with more than one language.

3. Don’t Spread Yourself Too Thin

A lot of people watch YouTube videos and read Medium, getting excited about the latest trends. It’s easy to jump from technology to technology, but that will slow down progress. Pick a couple of things to learn, and stay focused.

Make your choices appropriate to your goals. For example, if you want to become a web developer, don’t start with Rust or C++. If you want to work with data, learn SQL. If you want to be a generalist, try starting with a language like Python. After you learn one thing well, then gradually add more things.

4. Learn to Debug and Ask Questions

This might seem off-topic, but it’s where much of the learning happens.

Programming jobs tend to pay well, because you are the person who people are going call when they can’t solve the problems themselves. You have to become the kind of person who solves problems and bugs, possibly as the last person in a chain of people who have looked at the problem before you and failed to solve it.

When you get stuck, before running to ask someone else for the answer, stop and focus about what you’re doing.

  • Did you read every line of all of the error messages carefully?
  • Did you search Google for the error message?
  • Did you meticulously walk through the code line by line with debugging techniques to see where things might be going wrong?
  • Did you make small modifications to the code to see where the problem might be originating?
  • Did you try the rubber duck debugging technique?

If you give up too quickly and run to ask for help, the person you ask is going to do exactly those things listed above and they are going to wonder why you didn’t do them yourself before you asked the question.

This doesn’t mean that you shouldn’t ask for help, but asking for help shouldn’t be the first reflex you have.

When you do go ask for help, be sure you have read about how to ask good programming questions. There are some tutorials for that here:

Debugging things and asking questions are where a lot of the learning happens, so it’s important to invest some time in learning how to do them correctly.

Don’t worry too much about asking for help in the beginning, because people will expect that you are new, but as you start to progress you’ll be expected to learn the culture of debugging and asking questions. If you show that you are trying, people will want to help.

Discussions About Memorizing Programming Languages

It’s possible to use memory techniques as a supplement to the things mentioned above, though they won’t teach you how to code by themselves.

Here are some resources for learning how to use memory techniques like memory palaces, spaced repetition and peg lists to memorize programming languages.

See Also

Feedback and Comments

What did you think about this article? Do you have any questions, or is there anything that could be improved? We would love to hear from you! You can leave a comment after clicking on a face below.