DEV Community

Cover image for Those weird humans
Pato Z
Pato Z

Posted on • Edited on

Those weird humans

A bunch of young elves sit in silence by the fireplace of a wooden cabin in the north pole.

Eventually a tiny elf called Galadriel breaks the silence, "Grandpapa, can you tell us a story?"

"Sure thing, kiddo!" responds an elderly man with a long white beard, "I'll make myself a hot cocoa and be right there with you."

The old man approaches a cast-iron stove upon which sits a kettle and a pot of milk. A few minutes later, cocoa in hand, the old man sits in a rocking chair by the fireplace and asks the elves "Which story would you like to hear?"

"I know! I know!" says another tiny elf called Legolas, "tell us a story about..."

Those weird humans

"Ho ho, where do I even start!" the old man laughs, "I know, I'll tell you a story of good intentions, people getting carried away, broken toys and forgetfulness."

"Wow that sounds amazing!" young Galadriel shouts excitedly.

"The story begins not long ago, in this galaxy" the old man says while pulling the cowl of his robe over his head, "Humans used to worship this thing called OOP."

"Up?" asks Legolas.

"No no, OOP" the old man responds.

"Whoop?" Legolas tries again.

"Ho ho, that's certainly closer, but no, this is O-O-P which stands for Object-Oriented Programming."

The elves stare in awe until Arwen says "tell us more about..."

Oh-Oh Pee

Outside it's snowing, but this is not the usual snow. For some magical reason, around this cabin it snows all the time and yet the height of the snow is always exactly right. Ideal for building snow people and friendly snowball matches, but never high enough that you need to spend hours shoveling your backyard and over-seasoning your driveway with a ton of salt.

"Back then" the old man continues, "humans decided that objects in the real world only had two properties: state and behavior."

"Behavior was good, everyone wanted behavior, but state, oh no, state was something to be ashamed of, something to be hidden."

Something hidden

"They invented this thing called encapsulation that meant that objects would hide their state so that no one could know about it."

"Those were strange times indeed, the sole purpose of objects was to do stuff, not just sit around. There was not time for quiet contemplation back then."

"Eventually they started grouping objects together, solid objects and animals were very popular back then, although humans were obsessed with making all of them bark() for some reason."

Going too far

"Humans are excitable creatures. They have a saying that goes pretty much like this: when you have a new hammer everything looks like a nail."

"And, so they started seeing objects everywhere. Animals, People, Cars, those kind of made sense, but eventually they got carried away. Numbers, functions and even abstracts like dignity became objects."

"Back then the only way to accomplish anything was to pass objects around, but given that objects had all those enticing methods you could call, it took an enormous amount of restrain to write pure functions."

"It's like when you kids share your toys. They eventually break and when they do, it's hard to tell who broke it, where did it break and where are all of its pieces so that you can try to put it back together."

"Last week I shared my wooden car with Legolas and he broke it!" complains a little elf called Elrond.

"I did not!" says Legolas.

"You did so!"

"I did not!"

This goes on for a while until the old man continues the story, "...so apparently all those broken toys and impure functions had an unprecedented effect on the world, they triggered a..."

World-wide iron deficiency

"It turns out that most objects in the world were suffering from an iron deficiency that turned them into anemic objects, leaking state all over the place."

"Those were dire times to be an object, and almost everything was one."

"At some point humans got fed up with objects, leaking or otherwise and decided everything about OOP was wrong. They concluded that OOP really stands for Outrageously Overly-complicated Programs and moved on without a second thought."

"...aaaand that concludes our story for today!"

"But if they no longer used objects, did the have another way of solving problems?" little Elrond asks.

"Yes, lots" answers the old man, "like functional, logical, procedural, JavaScript..."

"Grandpapa" Galadriel moans with the most heart-warming sad-kitten face, "could we have one more story before bed time, please? Pretty please?"

"Alright, kiddo, but this is the last one!"

An older, newer story

"Before humans started worshiping OOP (or was it after?) they were obsessed with something called FP."

"What is it with humans and all this pee?" asks Legolas.

"Ho ho ho, FP stands for Functional Programming and it was quite different from OOP."

"Grandpapa" Galadriel says, "please tell us more about..."

Eph pee

"Well" the old man continues, "these humans got radically different views about state and behavior."

"For them state was something to put on display, where anyone could see it, but there was a catch, no one was allowed to touch it or otherwise change it."

"They called this rule immutability."

"Wooo" all the elves say in unison, with amazement in their eyes.

"Now the key to FP was functions, but not just functions pure functions."

"Remember that because of immutability you were not allowed to change things, so to get things done you'd use pure functions that take state and produce new things."

"But" Arwen interrupts, "how could you possible do stuff when you're not allowed to change stuff?"

"Ho ho ho, great question!" excitedly replies the old man.

The unexpected

"It turns out that humans also asked the same question, how can we actually do stuff if we cannot change stuff?"

"They tried really hard to come up with an answer to this question, tried different approaches but nothing seemed to work."

"They were getting desperate, they were prepared to sacrifice anything in the altar of purity and immutability but this problem seemed impossible to solve."

"And so, they did the unexpected, something no one could've foreseen..."

"What was it Granddaddy??? What was it?!" all the elves ask excitedly.

"They..."

Turned to the occult

"They realized that the only way to solve their predicament was by tapping into raw magic, into the most occult and forbidden of sciences: Math."

"They tried casting all sorts of math spells until one day, after a lot of effort and casualties, they managed to conjure an artifact of ultimate power."

"This artifact, forged in the fires of Category Theory was called the Monad!"

"Now Category Theory is a bucolic valley right next to the wine country region of Hell. If you're ever in the area make sure you stop and visit."

"But I digress back to the Monad..."

Shoulda, woulda, coulda

"These humans immediately became obsessed with these monads. Maybe it was that monads look deceptively simple. It was either that or that they felt just right."

"Whatever the reason, monads were too powerful an artifact to wield. They had the power to alter the fabric of reality and change the immutable, make state appear out of nowhere and to run code that couldn't run."

"One of the most powerful monads out there was called IO."

"Hey ho?" asks Legolas.

"I'm pretty sure that's the punk rock monad of dwarves" the old man explains, "this one was called eye oh which stands for Input-Output."

Hasta la vista, FP / I'll be back

"Anyway, every monad on it's own was an artifact of untamed raw power and to be able to combine them required impossible amounts of transformation magic. But even then being able to lift all those monads required an almost superhuman strength."

"Eventually those humans realized they were getting ripped with all that heavy lifting so most of them decided to pursue a more satisfying career as Olympic heavy-weight champions, body builders, Hollywood superstars, pop-culture icons, restaurateurs and some even decided to dabble in politics."

"And so, once more humans forgot about FP and moved on to the next new shiny old thing."

"I sometimes think that being human is about trying to find balance by moving exclusively between the extremes."

"And that is the end of that story."

Lots of jumping around

"Granddaddy" asks Arwen, "was there something before Eph Pee and Oh-Oh Pee? Maybe some other pee?"

"In the very beginning things were very strange, people would spend all their time randomly moving things around and jumping from here to there for no discernible reason."

"But this story will have to wait, kiddos, now it's time for bed, tomorrow we have a big day ahead of us. Lots of toys to compile, assemble, link and debug."

And so the little elves go to bed and the old man walks out to his bedroom.

E-pee-log

A couple of minutes later, the old man emerges from his room in his robe and slippers and looks at you, yes, you the reader.

"You're still here?" he asks shocked, "it's over, go home!"

Seeing that you are not leaving he continues.

"Oh, well, since you're still here, let me just say: you keep coding, code in whatever language and paradigm makes you happy and gets you excited."

"Don't worry about what people think or the hype, there's a lot of satisfaction to be had in punching holes in Fortran cardboard cards."

"Learn about other ways of doing things, the crazier the better, then share what you've learned with others!"

"That's it, it's truly over now, go home, go share a (virtual or real) meal with friends and family."

"And, if you happen to find yourself at home, alone, then order pizza, watch a movie and use your toys to build traps and ward off some wet bandits."

"Happy holidays!"

Top comments (0)