On coding and magic, a rant

Pablo Curell Mompo
4 min readMar 26, 2021

The hot take

All coding is fundamentally made of magic and leaps of faith.

A mysterious road ahead
A mysterious road ahead — photo by https://www.pexels.com/@pixabay

The shortish justification

It might be because I grew up with very close ties to the worlds created by Ursula K. Le Guin, JRR Tolkien, or JK Rowling. But I have always dreamt of being a wizard, a mage, or whatever term you want to give it.

And I believe the closest we can be to an actual wizard in the real world is coding. after all :

Any sufficiently advanced technology is indistinguishable from magic — Arthur C. Clarke’s third law.

Coding affects the real world and brings forth wonders that most people cannot fathom.

I had proof of it just yesterday. My mother-in-law discovered that you can have a tiger roaring in your living room thanks to Google’s Augmenter Reality. I do not exaggerate when I tell you that she spent an entire hour trying the different animals and laughing in wonder.

We coders (or developers, or software engineers, or however you wish to refer to yourself) are modern-day wizards. We should be proud of it!

Coding — Photo by luis gomes from Pexels

On the coding side

You probably are thinking to yourself, ok, I get it for the users, but how is code magic for me, the wizard, the mighty coder that knows all the languages from low-level C to high-level scripting Ruby?

I posit that the leap between your written code and the machine is an order of magnitude more magic than the jump between your code and what the user sees. That (I believe) holds even more true between low and high-level languages.

While we can strive to understand and study the magic and probably our ‘magic system’ is closer to the one in the Dresdenverse than the one in Middle Hearth, it is still magic. The overwhelming majority of us would not be able to consistently write at the compiler level.

Even the compiler is a leap away from the actual logic gates and constructions that end up making our coding spells work. We take it as a leap of faith. It is the framework of magic that gives us superpowers.

If you allow it, I will keep this doubtful analogy for the rest of this essay. I believe that, and I will gladly discuss with you further the logic for these corollaries:

Magic is magic

In the context that I am describing, which school of magic you want to use comes down to two things:

1 — What we are most comfortable with

2 — Which school of magic is best suited for your spell.

The scorn directed to some languages because they are too magic or not enough magic is mostly a matter of preference.

The same can be said about Functional or Object Oriented. Typed or Not Typed, etc.

You do not need to understand the whole foundation of magic

But it does help

I do most of my work in Ruby, more precisely in Ruby on Rails. I do not need to know exactly how Rails requires all the files.

Similarly, I do not need to know how Ruby translates itself to C (or Java) or how they translate to the assembler and the electric signals that power the whole thing.

But! Yes, it does help make more optimal choices, to have more practical magic to know as much as possible about it.

You need to choose when to write your spells or when to use Bob the skull.

Quick reference explanation. Bob the skull is the stack overflow of the Dresdenverse, a spirit of intellect that answers most questions.

When writing your code, most languages will provide you with libraries, be it packages, gems, shards, you name it. Some of them will give you access to functionalities that would take you too long to write yourself; others will just be a matter of convenience.

But I believe it is essential to not use a gem or a library as the default option. Think always of the cost of creating yourself the magic or relying on someone else.

Typical costs of doing it yourself are:

  • It will take time
  • Fewer people will test it and spot the mistakes

Typical advantages are:

Magic is hard work

Yes, the hard work is mainly to make it as effortlessly as possible, but it is hard work; it will demand a lot from you. You need to keep learning; you need to engage fully in each word and line of code you write. But is it not a small price to pay to be a wizard?

disclaimer

This is a rant, a hot take; please do respond but keep it in mind. I would love to debate on this and to have my opinions challenged and have a debate take place. Also, do ping me if you want fantasy book recommendations :D

--

--

Pablo Curell Mompo

Full Stack developer @ Seraphin, learned how to code @ Le Wagon. I love coding and plan to keep learning as much as I can about it :)