I’m Beginning To Think That Much Of Programming Is Wildly Subjective

Cyberdime
Published: December 5, 2022

From what I’ve seen and heard, a large portion of the programming community – myself often included – feels that much of what goes into programming is objectively good or bad. We all seem to have hills that we’re willing to die on because we believe that said hills are objectively the right choice. Vim vs an IDE; tabs vs spaces; functional vs object oriented; relational databases vs document stores; single-file components vs separation of concerns; single-letter variables vs intuitive variables; ORM vs SQL; Go vs ColdFusion; Angular vs React; single-quotes vs double-quotes; idiomatic vs pragmatic; monoliths vs microservices; REST vs GraphQL; the list goes on and on ad infinitum.

When I was younger, and unjustifiably cockier, I used to think that the choices I made were right because, why else would I make them? But, as I get older, I’m more keen to think that it’s all subjective. Your choices are right for you; and, my choices are right for me; and, we don’t have to sell each other on why we made those decisions. Programming is just wildly subjective!

The irony of it all is that in much of our lives, we’re totally happy to exist in the subjective. I think “Death Metal” is probably the worst thing ever; and, death metal enthusiasts probably can’t understand why Ani DiFranco is one of my favorite artists; and everyone is OK with that because musical taste is like 100% subjective.

My wife loves Brussels sprouts. It’s like literally her favorite thing in the world to eat. And for me, just a faint whiff of Brussels spouts and I literally get nauseous. For me, the idea of eating something that smells like rancid dog farts is just mind-boggling. But, she’s thrilled to gobble them down. And that’s OK, because food taste is like 100% subjective.

In fact, not only is so much of life deeply subjective, it’s also driven by our personal DNA profiles. I’m a morning person – I can barely keep my eyes open after 9pm. That’s my circadian rhythm. That’s my biology. Being a morning person is objectively correct given my personal situation.

I’m also an introvert. I’m always the first one to leave the party – always! I have about a 2-hour window where I can enjoy being social; and then, after than, I literally get uncomfortable – my body will actually start to ache. I don’t enjoy that. I wish people energized me. I wish I could be the life of the party. But, it’s just not how I’m wired. And, my family gets that and we’re all cool with me being the “anti-social one” because we all understand that we all have our own Truths.

So, we have all this highly subjective stuff in our lives, generally; and it’s totally fine; and then, we get into programming and we convince ourselves that there is something so objectively correct about so much of it! We convince ourselves that what feels right for us must feel right for everyone else. And, if someone has the gall to say that they don’t enjoy it, we start preaching to them about the power of uniformity (see any argument for linting or gofmt); and, how they should just suck it up and get on board because, somehow, looking at code that doesn’t look like your code is somehow a “Good Thing”.

For years, I’ve had an inkling – that it’s all subjective. But, I chalked those feelings up to a feeble mind and a lack of diversity of experience.

And then something magical happened. I started writing Adobe ColdFusion in my personal life and Lucee CFML in my professional life. And, while the two platforms have a tremendous amount of overlap, they also have some big differences.

In particular, Lucee CFML offers a feature called Tag Islands. This feature allows you to use CFML tags, like CFQuery, in a CFScript context. What this means, in a Lucee application, is that I can write all my components in script while still being able to leverage the readability, simplicity, and elegance of the CFQuery and CFQueryParam tags.

So, in Lucee – in my professional life – my data-access objects look like this:

component {
	public query function getThingsByFilter(
		numeric id,
		numeric otherID
		) {
		```
		<cfquery name="local.results" result="local.metaResults">
			SELECT
				t.id,
				t.name
			FROM
				thing t
			WHERE
				TRUE
			<cfif arguments.keyExists( "id" )>
				AND
					t.id = <cfqueryparam value="#id#" sqltype="bigint" />
			</cfif>
			<cfif arguments.keyExists( "otherID" )>
				AND
					t.otherID = <cfqueryparam value="#otherID#" sqltype="bigint" />
			</cfif>
		</cfquery>
		```
		return( results );
	}
}

And, in Adobe ColdFusion – in my personal life – my data-access objects look like this:

component {
	
	public query function getThingsByFilter(
		numeric id,
		numeric otherID
		) {
		var results = queryExecute(
			"
				SELECT
					t.id,
					t.name
				FROM
					thing t
				WHERE
					TRUE
				AND
					(
							:id <=> NULL
						OR
							t.id = :id
					)
				AND
					(
							:otherID <=> NULL
						OR
							t.otherID = :otherID
					)
			",
			{
				id: {
					value: id,
					cfsqltype: "cf_sql_bigint",
					null: ! arguments.keyExists( "id" )
				},
				otherID: {
					value: otherID,
					cfsqltype: "cf_sql_bigint",
					null: ! arguments.keyExists( "otherID" )
				}
			},
			{
				result: "local.metaResults"
			}
		);
		return( results );
	}
}

Now, I’ve been coding in these two competing styles for just short of 3-years. Newness is not an issue for me. Familiarity is not at an issue for me. Comfort is not an issue for me. And yet, after 3-years, using tag islands to execute queries in Lucee CFML feels so natural and so easy; and using queryExecute() to do the same in Adobe ColdFusion feels like some shit I have to do in order to get things done.

Since I’m currently using both of these techniques – and have been using both of these techniques for years – having such a strong feeling about one of them made me believe that one way was objectively better than the other way.

In fact, when I learned about Tag Islands in ColdFusion, it was one of those Eureka moments! And when I blogged about it, I was 100% confident that I would start a revolution; and, that everyone else would be rejoicing in tag islands, finally able to write SQL queries in Script with ease and with good affordance.

And sure, some people were excited. But, many weren’t. In fact, some people – like Scott Stroz – found tag islands to be downright offensive.

At first, I thought maybe these people were trolling me, just being facetious in their disdain. But, eventually, I realized that they weren’t joking – that they truly believed that the queryExecute() function was better – even more readable – than the CFQuery tag.

But how is that possible? I ran a 3-year natural experiment on myself, using the two techniques side-by-side, and found conclusively that one approach is hands-down better than the other! How could anyone possibly disagree with me?

Oh Shit! Turns out that it’s totally subjective! Turns out that what makes complete and undeniable sense in my brain doesn’t make complete and undeniable sense in other people’s brains. That what is true for me in programming is not true for them.

Now, you might be thinking that I’m over-reaching here – that I’m taking this one tiny thing and trying to extrapolate too much from it. But, as I alluded to earlier, I’ve had feelings about this for a long, long time! Just look at a quote from an article that I wrote about Linting 5-years ago:

My approach to code formatting is the best. If it weren’t, I wouldn’t use it.

Formatting is part of my being – an extension of my genetic makeup. And, when I write code, my formatting is the fingerprint that I leave behind. When I’m asked to change my style, I am – quite literally – asked to deny a fundamental Truth of my being.

Or, this post on var variable declarations in JavaScript that I wrote 7-years ago:

Now, with ES6, there are a lot of really smart people talking about how many of our variable declarations should be using const and let. But, I just don’t connect with the concept. While the explanations that I read are logical, they don’t strike a chord in me – they don’t seem to be solving a problem that I have.

I have lots of strong feelings about lots of areas of programming. And lots of people have strong feelings that diverge greatly from mine. And part of me used to think that one of us was either crazy, or naive, or simply rejecting anything that didn’t seem familiar. But, I’m now much more inclined to believe that we are all correct in our own context. Those strong feelings that we have about some aspect of programming – they are correct. For us. And maybe not for anyone else.

The thing that sent me down this mental rabbit hole was a conversation that I had the other week with Jonathon Wilson – another Principal Engineer at InVision. I was expressing my fear that when I move from using ColdFusion on the legacy platform over to using Go/Golang on the modern platform, I wasn’t going to enjoy it; that it wasn’t going to spark joy; that I would be unhappy.

In an attempt to alleviate my anxiety, he something to the effect of:

Don’t worry about it – ColdFusion and Go aren’t that different – it’s just syntax.

It was that phrase, “it’s just syntax”, that haunted me after our conversation. As if the syntactic choices of Golang were something I could just get used to or look past. And, I’m sure I can do that. And if my job requires it, I will do that – I am a team player (or at least I like to think I am).

But, at least for me, “syntax” isn’t just part of a languageit is the language. To me, a language is the collection of syntactic choices. For the most part, that’s what makes one language different from another. That’s why I have zero desire to write Assembly language, and I dream about CFML in my sleep.

ASIDE: I understand that there are “generations” of languages; and that Assembly and CFML are not in the same generation. I use that comparison because the differences are stark and illustrate the power of syntax.

Now, here’s the kicker – that’s probably subjective. Meaning, there are very likely people for whom syntax isn’t a big deal – that they can seamlessly float from one language to another language and not give it a second thought because that’s how their brains work. But for me, that is not “The Truth”. Syntax appears to be a huge part of why my brain finds some things natural and some things opaque.

It’s all subjective. And, there’s nothing you can do about that other than try to keep it mind before you foist your perspective on someone else. Just keep in mind that what is true for you may not be true for them, no matter how deeply you feel it in your bone marrow. I say this as much to myself as I do to anyone else. I need to remember that the things I love are just that — the things I love. And, have no bearing on what you might love.

Check out the license.

Source: www.bennadel.com