JavaScript: The Language We Deserve

Some of this started as a few threads on facebook and twitter, during the preparation for a large professional project building an IVR phone system with the Freeswitch JavaScript API. The application is interesting because it has nothing to do with “web programming” as a specialization.

It started out something like

This was preceded by some naive ramblings about javascript sucking, which happens to be an opinion shared by many. There’s even a website dedicated to the subject.

A long time friend and mentor recommended JavaScript: The Good Parts by Douglas Crockford. A book published in 2008 which I have heard of before but never picked up for the following superficial reasons

  1. It is about 140 pages
  2. The other book on javascript is 1200 pages (…The Definitive Guide)
  3. The difference between the size of these books made me laugh, because they supposedly write about the same subject

A few other friends/programmers recommended stackoverflow. The superficial instinct kicked in again. I’m not going to trust the canonical reference to a programming language let alone a whole software platform to a crowdsourced website!

I was wrong about both judgments. The Crockford book is excellent. Sharp and cutting. It’s almost like it talks about a different language. And stackoverflow is a very good advice community for professional software developers.

I hereby retract my statement that JavaScript sucks. Thanks in particular to Chris Sattinger and Kevin Prichard for excellent advice. I’m on chapter 4 of the Crockford book. It’s changing my perspective in a major way. I’ve already found some features in ES6 that effect real world problems.

I still defend that the language design of JavaScript sucks because there are a large number of bad words in the core platform, which are unclearly obsolete. Sort of like how there are a bunch of American Frontier swear words that are obsolete. Using a word like “varmints” today might be offensive or bad but really it’s just confusing and sounds stupid. JavaScript has words like this, metaphorically. It seems that learning not to use them is part of the craft.

On the good side, the whole prototypical inheritance object model is awesome and I think every language should work this way. Chapter three of the Crockford book is excellent and changed my whole perspective of object oriented programming in only six pages.

It also feels like JavaScript’s contemporary success is a product of the web, much like the language itself. Not just because of the platform for execution and debugging being a web browser but also because the knowledge about the language seems to be a product of social media. I’ve got more help from people on social media about the use of this platform than my staple for the past: IRC, email and programming manuals.

Kevin said “JavaScript isn’t the language we deserve, it’s the language we need”. I disagree. I think it is the language we deserve if “we” means people who have worked in the web business since “round one” (read the late 1990s). This industry is young and populated mostly by quickly built, incomplete software platforms that give a good demo but take the work of countless (global) villages to do anything more interesting than that.

We got what we deserved. A programming platform that doesn’t make much sense to the skilled but is the default language of the “learn to code” business. The number of eyeballs focused on all the JavaScript implementations, JITs, interpreters, frameworks, libraries, specifications, package managers, etc is astounding.

I think it’s also what we deserve because of the vague overloaded context of what “the internet” means in 2016. When speaking of “the internet” most people speak of the www (World Wide Web, for the readers under 30). Other people are just talking about their phones as the device which allows them to “do internet”.

To say “I want to learn to code JavaScript” doesn’t mean much. Code what? front end, backend, frameworks, optimizing compliers, music applications, telephone systems, mobile location messaging services? There are so many options it’s almost an academic exercise to “learn JavaScript”. There are people who argue over how to name JavaScript to describe the intentions better.

The real value comes with frameworks, libraries and target platforms. For example, there’s an entire computer music framework implemented in JavaScript. Another example, (tho I haven’t used it) is the web development framework AngularJS. It hides much of the JavaScript part of the language from the programmer. In fact, the marketing tagline for AngularJS is “HTML enhanced for web apps.” This is false. It’s really like “JavaScript enhancing HTML by including JavaScript to help you build web apps”. I think the Google copywriters did a better job than I in the brevity department.

But whatever, it doesn’t matter since we all regularly interact with a big giant pile of JavaScript code every day through our web browsers. I was blown away to learn that by default, Chrome is not just a way of looking at web sites, it’s a fully functional interactive IDE for developing web sites.

There’s been some joke pieces and think pieces about generational differences between how people refer to the www. For me, after 20 years, I don’t care. It’s all internet.

The www is dead, long live the internet.

…JavaScript is the language we deserve.