The Tremendous Impact of JavaScript
According to ZDNet, there are 12.4 million JavaScript developers worldwide. JavaScript is considered the “programming language of the web,” and it was first implemented by Brendan Eich, in 1995, in just ten days before he was able to work in some much-needed improvements. To go along with the theme of this series, I will now note that you can find Eich’s work here, in all of its 1995 glory. They even got the thing to compile (yes, compile!).
To say that JavaScript was invented in ten days is a rather contentious topic that highlights the difference between a programming language and a programming language’s implementation, but to say that it was first implemented in that time is mostly correct. The work of meticulously examining and building the source code may have felt more like archaeology than programming, but like archaeology it can allow us to understand Eich’s design decisions in an effort to better work in our current situation.
Or we could just…I don’t know…look up his profile on Quora. Brendan wrote his implementation in 1995, not 1795.
JavaScript was Made in a Very Competitive Time
Before going into any more detail, JavaScript was named after Java even though the two programming languages are (and were) very different. JavaScript was supposed to be a “scripting language for the web,” and its story is well-documented in A Brief History of JavaScript.
On one side of the story you had Netscape, a company that employed Eich and agreed that they should invent a new programming language specifically for “playing with the web” — Eich believed Java was too big for the task. On the other side of the story, you had Bill Gates and Microsoft. JavaScript became popular and successful, so Microsoft built their own version called JScript and used it in Internet Explorer. Internet Explorer went on to crush all competition and dominate the market until Mozilla Firefox and Google Chrome came along.
Someone wrote a Quora post about it. This is my favorite Quora post, period, and it makes the “Browser Wars” sound like some sort of epic medieval fantasy series with obvious heroes and villains, instead of the story of two modern-day software companies having fairly typical competition.
Some Key Design Decisions
Eich wrote JavaScript to have a familiar syntax for Java developers. This fact and the fact that JavaScript was meant to complement Java, I think, is really overlooked by people who simply state that the two have nothing to do with each other…but yes, they are very different. Eich also treated functions as first-class objects, meaning functions were just another object type, and he chose to use a prototype-based object model in contrast to how class-based languages like C++ use the concept of inheritance. Each approach had its trade-offs.
Today, many of Eich’s original design decisions still hold. Some people like them. Some people do not. But instead of focusing on how annoying (or great) it is to deal with JavaScript’s typing, or how different it is to work with JavaScript’s scope, it may be useful to remember that JavaScript was essentially popular from the beginning, and that even some of its most “hated” features have their own advantages.
The name is pretty confusing, though.
Closing Thoughts
Marc Andreessen and Jim Clark believed that the Internet would be the next big thing — they even boasted that Microsoft personal computers would become little more than access points into the web. They did not go on to crush Microsoft with Netscape, but perhaps they were right about the web.
The story of the web is a story of fierce competition and rapid development. The story of, say, Unix and C sounds a little bit more like collaborative research by some very brilliant people than intense competition. This is not to say that the achievements in Unix and the first implementation of C were any less impressive or rapid…it is simply to suggest that early web development came about in a very unique set of circumstances, and that makes its story special.