White to move and mate in 3

JavaScript’s Sword of Damocles

Richard Kenneth Eng
JavaScript Non Grata

--

The following video nicely illustrates some of the many semantical and syntactical WTFs that plague JavaScript. Despite the wonkiness of the language, though, Kyle Simpson still loves JavaScript, and this is where Kyle and I fundamentally disagree. To me, at least, the many inconsistencies of JavaScript weigh over me like a Sword of Damocles, threatening to trip me up if I’m just a wee bit careless. Kyle insists that if you study the language spec meticulously, you will come to understand why JavaScript is the way it is (historically) and how to use it appropriately. That may be so, but it doesn’t make JavaScript any easier to learn; ease of learning was one of the key reasons for its rising popularity.

The point is that, while you can mitigate most of JavaScript’s problems by using JSLint and reading Douglas Crockford’s book and meticulously studying the language spec and exercising caution and awareness, all of this represent an unwelcome cognitive burden on the programmer, as if software development wasn’t hard enough as it is. I can’t say this often enough: There are many better languages out there that can transpile to JavaScript. Ubiquity in the web browser is no longer a sufficient reason for choosing JavaScript, nor is the ecosystem of libraries (all transpiled languages can import JS libs). Languages like Smalltalk and Clojure and Scala and Elm are at least as expressive as JavaScript, if not more so. And it would be difficult to argue that there is a simpler and easier-to-learn language than Smalltalk.

--

--