#32 Language Shouldn’t Get In The Way

This is post #32 of my #365 day series.
Photo by Markus Winkler on Unsplash

Don’t get me wrong, I like experimenting with new tech all of the time. My recent foray was into the mystical promised land of TypeScript. What is TypeScript? It is what is referred to as a superset of Javascript, which means that it is built on Javascript (JS) but has some additional syntactic sugar and features layered on top of JS. What is JS? I’d stop here and just go googling for a bit and then circle back once you have a keen grasp of what JS before you continue reading. There may be parts that you can glean lessons from, but unless your a coder or have a cursory understanding of javascript, the rest of what I’m about to write won’t make a ton of sense.

Ok, first, let’s get the basics out of the way. Read https://dev.to/jfbrennan/the-reasons-i-don-t-use-typescript-2fhb for an excellent write-up on why TypeScript isn’t for everybody. If you’ve worked with a strictly typed environment, a language that is unforgiving in compiler issues, then you understand what I mean when I say “why the f*ck would you ever subject yourself to that”? As a broad generalization, I think of TypeScript as bumper lanes for this generation’s bad coders. If you have a massive sea of programmers that can’t maintain standards or compliance with basic programming patterns, then TypeScript makes a ton of sense. If, however, you’re dealing with a handful of very experienced developers who don’t want to spend more time going down configuration hell, rather than just getting the business logic to work in a clean and secure manner, then stay the heck away from TypeScript. Pickup another language like C, C++, or Java for that matter, if you want to learn what discipline means. Adding interfaces and at least three steps before I can get a function out is absurd. Especially if I ever just want to prototype something.

I would say that TypeScript might be great in large production environments. But honestly, create a JS Class and move on with your life if you want to create strictly typed interfaces (I’m not even sure if I’m using that phrasing correctly at this point). The herd mentality is real here. To understand why this type of behavior is bad, you have to understand the hierarchy of programming languages.

There’s this concept in software engineering knowing as trying to be “close to the metal,” which means as close to the barebones of the logic processing as possible. CPUs operate under the basic premise of binary logic (0s and 1s), sometimes just referred to as machine code. Obviously it isn’t so easy to program languages if all we did was write 0s and 1s all day, so we write programming languages on top of the binary logic. Every layer of interpretation or language that we build on top of binary logic is referred to as an abstraction layer. So from binary logic the next step up is assembly language. Assembly is assembled (read: translated) into binary logic. That process costs compute power. A level above assembly is C or Java. We call them “compiled languages” because they compile down (read: translated) into assembly and then binary. A level above the compiled languages is called “interpreted languages” which means that there is an engine that is written in a compiled language that translates the interpreted language down to a compiled language and then the compiled language is distilled down to assembly and then binary (before the haters pile on, that’s not exactly how it works, but it gives you the gist of things). The lines blur a bit on what is a scripting language versus an interpreted language, but Javascript is, you guessed it, a scripting language. It runs in a web browser, which browser is built on some other programming language (such as C++). So with Javascript there are a few layers of abstraction before you get to the bare metal.

Adding layers of abstraction onto a scripting language is ABSURD. We’re basically creating a map to help us read another map. We already have abstraction away from binary and assembly level code. Why the heck would I make my life more difficult? For what gain? Compliance? Standardization? I’m an adult thank you very much. At this point I can maintain standards. If I’m concerned with messing up variable types, then I should be coding in C++ or Java and not be relying on the flexibility of a scripting language which should have made my life easier.

I’ve said this a million times, both in programming and when practicing law, language should not get in the way of the logic.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store