On Writing Software
All that follows is simply one traveler pointing at the road. Take what you can and move on.
There’s one truth that I see inside of software development. Beyond the frameworks, libraries, or paradigms, there’s some truth that is hidden underneath the abstractions that all great developers see and understand. This post, besides for narcissistic ramblings, is an attempt at pointing at that something.
Object-Oriented and Functional alike point at this truth. When we code “properly” we are seeing this truth, knowingly or not. Turing saw this truth in his Enigma machine, Margaret Hamilton saw it while bringing us to the moon, and “Uncle Bob” may even be pointing at it within his books ( signaling worries aside ). This truth is not the shadows on the cave wall but rather those entities that are casting them before us.
Shadows on the Cave Wall
Plato’s allegory of the cave is a story about prisoners tied up inside of a cave, forced to stare at shadows being cast by people unknowingly behind them. For all of time, those prisoners are left to guess what is causing those shadows. They believe that it is actual leopards or tigers or bunnies behind them; they believe fully that the shadows they see are real, they are something.
Plato goes on to say that if we, the audience that knows the “truth”, were to bring these prisoners out of their cave, they would fight tooth and nail to get back into the cave, to get back to their comfort zone. He talks about how we, as humans, have a hard time accepting that the life that we had lived was merely shadows and will fight ferociously in order to preserve what we see as “truth”.
Every single person we come across on this path, including ourselves, are the prisoners within that cave. We are all simply guessing what is real and are scared to death of that being wrong. How many discussions have ended with “Oh, yeah. We are saying the same thing” after minutes if not hours of stress and arguments?
This issue is compounded the further and further away the seed of “truth” between two people/prisoners is.
Suppose, for a moment, that there were two people: one red-green color blind and another with “perfect” vision. As the latter person tries to explain to the former what “green” is, the former honestly and with the best intentions, cannot fathom green. Their shadows, their “truth”, does not go along with the others.
Does this mean that the color blind person is “wrong”? Is their reality null and void because their truth is different from our truth? Does this mean that we, as the “knowers of truth” can say to the other “Your brain is wrong, mine is right”?
Colors are shadows on the cave wall
What if instead of people with different vision abilities, we had two developers that each saw the “path” differently? One thinks OOP is the way to describe the shadows while the other thinks Functional. Which one is correct? Which one gets to decide how the rest of the group describes the shadows?
Paradigms are shadows on the cave wall
Finally, imagine we had a team full of “good actors”. Everyone is working towards the benefit of the team only and fully dedicate themselves to the growth of the team. What happens when one says waterfall is the path and one says agile? Which one is true?
Processes are shadows on the cave wall
Everything that we hold true, every “fact” that we build our world upon, is simply a shadow on the cave wall. We have nothing but guesses, we are given nothing but shadows. The only thing that we know for sure is that, because we are thinking on truth, that we alone are experiencing the shadows.
Coding With Shadows
There’s a quote that gets repeated time and time again within the computer science world
Programs must be written for people to read, and only incidentally for machines to execute.
Harold Abelson, Structure and Interpretation of Computer Programs
With hubris, I adamantly disagree. If we are not certain if things that we take for granted, like the colors we see, are “true” or not, how can we ever hope to write abstract thoughts such as a user in a way that is understandable? If all we know as humans are the shadows we have seen, what chance do we have of explaining those shadows to others from other caves?
Code is a shadow on the cave wall
What if instead of us coding in shadows we were the ones that cast them? what if we cast the shadow of a user instead of building a user out of shadows? What if we wrote code for the worker instead of us fallible humans?
It is the ability to understand the castings that Turing, Hamilton, and Uncle Bob have in common. It is this ability that points us towards the “truth” or that helps us write “good” code. It is this ability that sets us free as developers from the shadows that came before us.
Too often do we as developers accept the casted shadows as truth and move on. It’s not purely our fault: it works, our bosses need it now, et al. Perhaps we looked at the shadow and say that it was labeled “foo” and we assumed that “foo” was what we thought “foo” was. We gave meaning, based on past experiences, to “foo” that may or may not be real.
Regardless of who is at fault, the onus on fixing it is on us. We can either code looking at shadows or we can code causing shadows. The latter is the “truth” while the former is what Harold Abelson purports as “good” above.
Shadows All the Way Down
I do not claim to know the truth nor do I think I can see those behind us. I, just like you, am simply pointing at the shadows before us. In fact, all I have said before now has been a shadow for I lack the ability, the knowledge, to properly explain the casters.
But I know that down the path of working in shadows instead of with shadows has been the root cause of all issues arising during the development practice. I know that casting shadows for others to understand is a fool’s errand and only meant to keep us happy never looking behind us.
There is a truth behind us. But it is, itself, a shadow, a mirage of “truth”. And it is that truth, it is that caster of shadows, that I am pointing at. That regardless of how far down the rabbit hole you go, you will find that all we do is deal with shadows, that every word we speak is a shadow of intent, that every action we take is a shadow of a desire, and every line of code we write is a shadow of the truth we knew at the time.
Where does that leave us, then? If our entire job is to make the shadows appear as Product or Management want, how can we complete our mission without dealing in shadows? Without manipulating the truths that others have said?
That, my friend, is the million dollar question. And one that Chomsky has more to do with than we think. But that, dear reader, is a tale for another time.