How I learn new programming languages & frameworks

I used to learn by building things — I’d get an idea that matched the tool I wanted to try out, and I’d kind of stumble around trying to find the way to express concepts in code if it wasn’t immediately apparent.

I still think this is the best way for programmers who are starting out to learn — just start building stuff! — but learning new things in this way means that you might miss some of the paradigms and principles which went into the design of the tool that you’re trying to learn. Or, to put it another way: if you know programming, then you want to actually learn the tool. Sometimes, even the experts are going to have to learn programming by learning a new tool.

So, here’s how I go about learning and retaining knowledge about a new thing:

1. It’s all about the tutorial

Find a tutorial that works. It has to be well-written, and you have to trust that it has a clearly defined scope that it succeeds in delivering. Svelte’s tutorial is a good example of this. This could be an interactive tutorial, or just an article describing a particular feature set, or even a whitepaper or language specification.

Generally, the easier it is to know a linear path through this tutorial, the more success you’re going to have.

I don’t like video tutorials — they’re never at the right pace for me, and they never feel as crisp as an editable document can feel. Likewise for podcasts. I prefer websites, then properly-formatted eBooks, then physical books, then PDFs. I have to be very motivated if the best format for a tutorial is a physical book.

2. Make lists

Read the thing. I make four lists — yours might be different:

  • Things I like
  • Things I don’t like
  • Things I don’t know how to feel about
  • Flashcards to make

Here’s an example for that same Svelte tutorial:

  • ✅ Things I like
    • "await" blocks are super cool
  • ❌ Things I don’t like
    • I don’t want to write CSS in the same file as the rest of my component
  • 🤔 Don’t know how to feel
    • <slot> is a little weird to me
  • 📓 Flashcards
    • bind:value as a shorthand for bind:value={value}

I really find that the "things I like and don’t like" paradigm is the best way for me to approach things, but do what works best for you!

3. Learn it forever

I am a very vocal proponent of Anki, an application which helps you make and review flashcards. I keep flashcard decks for a variety of topics: not just programming, but also remembering the artist behind works of art, other trivia, and even remembering people’s names.

Every time I come across a concept in computer science or programming that’s new to me, I at least make a note to make a flashcard for it later.

Once I’ve finished working through the tutorial, I’ll take a look at my lists — not just the "flashcards" list, but every single one — and decide which bits of trivia I want to remember forever. Depending on how foreign the language or framework is to me, this could end up being a lot of material, if I don’t yet have the syntax or builtin methods completely down yet.

More importantly, though, is when I come across a concept that will somehow transform the code that I write in every language. Even if it’s just a definition of a term that allows you to sort programs into two types — say, the distinction between composition and aggregation, or what a shadow DOM even is — these things will allow you to think about code in a different way.

Truly, the thing that is most important to me is finding more tools for my toolset: not just electrons on disk that allow me to accomplish tasks in different ways, but different tactics and frames of mind that can help me see a problem and quickly find an obvious and elegant solution with code.

This is why having a routine based around reviewing flashcards is so important to me: certain aspects of programming are like riding a bike, and I’m certainly never going to forget them, but others are instructions that I will simply never use. But in order for those concepts and tools to remain in my arsenal, subtly lending strength to the things I do use directly every day, it’s not enough to just remember that they exist in the first place: I have to feel like I know them.