(Most) Coding Diagrams Are Useless – Learning to Code Using Analogies

The other day, my friend Robert Williams sent out the following Tweet:

And he’s exactly right.

A diagram connecting a few labeled boxes to a picture of a browser doesn’t do much of anything to explain how web applications work.

That’s why I never rely solely on diagrams like the one above in my own course. Instead, whenever possible, I explain all new concepts using analogies.

The power of the analogy

When you’re learning something new, you usually have no context for it. That’s part of the problem. You have no way of connecting these foreign concepts to anything you already understand.

And that’s why I love using analogies.

Here are just a few of the analogies I use in my course:

  • ”How does a database work?”
    Well, I’m sure you’ve used a filing cabinet before…
  • “What’s the purpose of using a framework?”
    You know how every house is built on a foundation…?
  • “What’s MVC?”
    Actually, it’s pretty similar to playing with Legos

If you’re learning to code, you probably don’t know what MVC is, or how databases work, or what the hell you use a framework for.

BUT you do know how to play with Legos, the purpose of a filing cabinet, and (I assume) that houses are built on foundations.

So when I explain the foreign ideas — the coding ones — side-by-side with things you already know, it allows you to develop a strong mental connection to this new knowledge — a pathway, if you will. It opens a door for you to include this new concept in your memory, by including it as a connection to something that already existed in there.

Learning a new concept using an analogy

Learning a new concept using an analogy

And from then on, that connection can be “referenced” when you need to recall the new coding concept: “What’s MVC again? Oh, right! It’s like building something with Legos. The request comes in, and …”

Learning new things doesn’t have to be as difficult as people try to make it.

And you can put this “trick” of using analogies to use on your own, too.

The next time you’re attempting to learn something and it isn’t explained very well, try making up your own analogy. Read through the explanation of the new concept a few times; then try and think of something you already have intimate knowledge of that you can compare it to. That way, you can cement the new knowledge in your brain via that connection — via the analogy.

I’m always looking for new ways to help make the process of learning a new skill easier and more enjoyable for noobs. (After all, noobs are my people!)

Because when you’re learning something new, the facts are easy to come by. It’s consuming them in the proper context that determines how effective you are.

So remember: when you’re learning something new, connect it to something you already know. And avoid useless fucking diagrams.

What’s something you’ve learned using the help of an analogy?


Alex Coleman helps others learn to build web applications with Laravel. His articles and courses have helped over 10,000 developers level-up their PHP web development skills and learn to build and launch their own web applications to the world. If you enjoyed this article, then join his free newsletter.