Syntax

Every industry, culture, clique, etc.. has their own syntax. It’s what defines that group and creates the connection between them. It also simultaneously separates and discourages others from becoming a part of it.

A family member recently reached out to me about programming languages to learn. I explained that while I don’t know that many, I have the confidence of knowing them all, because I understand some basic core concepts that are translatable across all programming languages. Beyond that, it is just a matter of syntax.

I saw the movie “The Big Short” the other weekend. I was curious what some of my friends who work in the finance industry thought of the movie. We agreed that the movie succeeded in conveying some complex topics in an easy to comprehend way. Most people, including myself, don’t know the financial syntax — and ultimately get taken advantage of for that lack of knowledge.

Travel to any foreign country and you might have similar experience— it is proportionately difficult to embed yourself in the local culture the less you are able to communicate using their special syntax.

I would love it if everything important — tax forms, 401k plans, credit card options and fine print — was explained in the form of (____)for dummies.

I am infinitely more impressed by someone who can boil a concept down using dead simple syntax than the “expert” who covers up knowledge gaps with complexity.

No one wants their doctor to tell them that they are experiencing Sphenopalatine ganglioneuralgia, when really they just have a headache from eating ice cream too fast.

I think it displays the highest sophistication of understanding when someone in their profession can boil something down for me in dead simple syntax. It requires empathy to actually internalizing their experience, and imagine it from their perspective.

Questions:

  1. Why can’t syntax be easier to understand? Legal contracts in layman terms, economic lingo that is inherently simplistic, not overly complex and intended to confuse. Tax forms that read like Dr.Seuss.
  2. Spread the syntax. Digitally annotated guides to your W-4, rental contracts, etc...

P.S Some Syntax

var regularize = function(str) {
return str.toLowerCase().split('').sort().join('');
}
function isAnagram(word1, word2){
if(typeof word1 !== 'string' || typeof word2 !== 'string'){
throw new Error('isAnagram requires two strings as input');
}
var str1 = regularize(word1);
var str2 = regularize(word2);
if(str1 === str2) {
return true;
} else {
return false;
 }
}
isAnagram("hectares", "teachers")
-> true

The above is an algorithm I wrote to check whether two words are anagrams for one another. The function “regularize” relies pretty heavily on some special javaScript syntax that might be confusing to someone reading it for the first time. On the other hand, it makes the algorithm significantly shorter and easier to read. Perhaps I should add some inline documentation as to what operations the split, sort and join functions perform and on the string.

As a developer, I am always thinking about how to simplify my syntax. My goal is to make it as easy as possible for the next person that reads my code to assimilate themselves as quickly as possible.

I’ve realized that to simplify something requires spending a lot more time thinking and less time doing, and is in itself a practice in self-restraint.

more thoughts later…