Skip to content

A Misunderstood Language?

bebraw edited this page Apr 2, 2013 · 5 revisions

As you might know the first version of JavaScript was developed in mere two weeks at 1995 by a fellow named Brendan Eich over at Netscape Corporation. Initially the language was known as LiveScript but the marketing men decided JavaScript sounds more believable. After all it was the decade of Java. On retrospect it wasn't a good choice and a lot of confusion has ensued. Java is to JavaScript as ham is to hamster. Keep that in mind!

So how would you characterize JavaScript? Even though it looks a bit like Java or C due to bracing there it is actually an implementation of a couple of powerful languages in disguise. These languages are Scheme, a variant of Lisp, and Self. From former JavaScript inherited some of its functional programming capabilities whereas latter gave it prototypal inheritance system which in some ways can be considered superior to classical one used by languages such as Java.

Particularly JavaScript's functional capabilities make it in some ways an exceptional language. Prototypal inheritance has caused a lot of confusion but it is possible to get around that. In fact it is possible to implement a classical system using it.

Of course JavaScript comes with the usual imperative programming constructs (for, while, if, etc.) you might expect. There is also some legacy in form of Date and Math modules inherited from Java 1.0. There are some custom features even (with comes to mind) though it is better to avoid some of those.

In fact you can get a lot done by selecting a subset of the language and then using that to its full extent. As JavaScript can feel a bit unwieldy sometimes people have implemented languages that compile to JavaScript. These languages provide some constructs not found in the language and can for instance provide stricter typing.

altJS lists these languages. Have a look at a few of those. Keep in mind, however, that in order to get most out of the languages you are better off learning JavaScript well. It will definitely help when you are trying to decipher the code they generate.

Clone this wiki locally