the sound of rain.

For this year’s O2A2 jam I was originally going to write a gothic horror about death. There were two big problems, however: making a gothic horror interactive fiction with just 1000 words turned out to be trickier than I was hoping for; and I already had like 5 other projects about death.

So it ended shifting direction a bit at the end, while still being roughly about death. But there’s more than the literal ceasing to materially exist in this world that a game can cover, right?

There will be spoilers in this article, so you might want to spend a few minutes playing through the game first.

When is OOP not that great?

As you might know, I really like object-oriented programming. I also have designed and implemented several object-oriented languages. Which, in turn, means that I’ve seen plenty of the not-so-great sides of the idea, both in the theory underlying it and in actual language implementations.

So let me rant a little bit about the things that have not brought me that much joy.

Why is `({})` true in JavaScript?

JavaScript’s abstract equality might sound quite daunting… until you realise that pretty much every operator and function in JavaScript has the same problem. After all why does JavaScript’s equality and ordering works the way it does?

The direct answer is “coercion polymorphism”[^1]. But since this is unlikely to tell you anything useful, unless you have implemented either JavaScript or similarly polymorphic languages in the past, let’s go in a short journey of how JavaScript operators work, with a particular focus on the idea of equality.