Computers Are Magic

April 30, 2024

Disclaimer: This post is unapologetically romantic.

Wizard casting a spell into a computer

When people ask me why I’ve chosen CS over other majors/careers, I usually respond something along the lines of: “Computers have interested me since my youth”, or “I’m driven by the creative power of computers”. These are understatements, though, and they do a poor job at conveying the nature of my feelings towards CS. The real reason is something more like “I’m drawn to computers because they are magic”. That response probably wouldn’t do too well in a job interview, but I think it’s a much more compelling idea, so I’ve decided to outline it here.

Noticing Similarities

I don’t think “magic” can be formally defined; most of its meaning is carried in its connotations. Instead, I will make direct comparisons between traditional magic and computers.


Magic allows us to do things that the laws of nature would otherwise not permit, e.g. levitation or telekinesis.

Computers allow us to do similar things: I can program a robot arm to move when I press a button a remote.

When you consider the realm of information (where computers have significantly more power), this becomes way more apparent. Computers can perform basic arithmetic and logical operations unfathomably quickly, and they can perform more complicated computations in blinks of an eye.

In a world run by information and knowledge, this is just as (if not more) useful than traditional magic. With computers, you don’t need an enchanted book to open itself to the page you’re looking for: you can just use Ctrl-F. Telepathy is of little use when you have Discord. Writing computer programs can optimize your computer workflows even more than casting spells could optimize your life in the real world.


Power alone doesn’t imply magic, though: magic also has a notion of unfair exchange1. For example, a spoken spell that turns a person into a frog is not only impressive in terms of its power (humans cannot be transformed into frogs by mechanical means); it’s also impressive because the act of uttering the spell takes grossly less effort than it should (even if humans could be transformed into frogs by some non-magical process, there’s no way that process would be as easy as speaking a few words).

Computers work the same way: an action of little effort can cause a computer to perform an action of great power.

Programs = Spells

Running a program is a lot like casting a spell. By saying the name of the program (in the shell), or by clicking on the icon, an incredible amount of computation is immediately done, and the power of the program is at your fingertips.

Writing programs is like making new spells. It’s a slow and tedious process: that’s why wizards have a limited number of spells (if it were easy, they’d constantly make new ones for every task). Because of this, wizards frequently rely on spells they’ve inherited from other wizards; they often learn about them from books and libraries.

One wizard alone (even when working manically) can only develop a few dozen useful spells. However, one who is well studied can fluently combine the spells of older and wiser wizards to form their own hybrid use-cases.

This process is practically identical to software development.

The Supernatural

Magic usually is implied to be based on some inherent (yet unknown) properties of the universe. Most wizards recognize this, but only a select few (if any) have deep understandings of it: most wizards accept that they can’t understand the essence of magic, but they do their best to pursue as much knowledge as they can.

Computers have the same property: they’re based on mathematics and physics. Few programmers really understand how computer works from the transistor upward (and if they do, it’s probably on a high-level), so they accept the properties as inherent yet unknown.

Extended Metaphor

So What?

I’m honestly convinced that, for all practical purposes, computers really are magic. This is important, because if magic exists in the world, I’d like to master it. Who wouldn’t?

It’s all too easy to imagine yourself in a fantasy world where classical magic exists. I suspect that most people would say that, when placed in that world, they would put great effort towards becoming a maximally skilled wizard. But would they really do that if they were actually there?

Computers are the magic-system of our world. Their ubiquity makes it harder to see their magic, but it’s here. The world’s biggest magical library (the internet) has its doors wide open. The road to mastery is at your fingertips.

  1. The alchemic notion of equivalent exchange doesn’t imply fair exchange. Just because two objects are materially equivalent doesn’t mean that they are of equal utility. Transmuting a broken radio into a working one still is an unfair exchange, even though the materials of the two radios are the same. ↩︎

  2. This is a lot like the cover of the dragon book, where the image of a knight fighting a dragon represents a programmer battling the complexity of compiler design (where the sword is the parser generator, the shield is Syntax Directed Translation, the armor is Data Flow Analysis, etc.). ↩︎