JavaScript: A Blog Post Made in 10 Days

Adam Collins
FullStackHacks
Published in
7 min readMay 2, 2017

To understand JavaScript you have to go all the way to the beginning of the web. Today the web browser is ubiquitous with the internet, but that wasn’t always the case. Tim Berners-Lee invented the World Wide Web in 1989. It started as a means to send text based web pages across the internet. Berners-Lee went on to write the first web browser in 1990 and publicly released it in 1991.

The first web browser to gain mass appeal was Mosaic. Released in 1993, Mosaic was developed by Marc Andreessen and a team of undergraduate programmers from the University of Illinois. At the time they were all working at NCSA (National Center for Supercomputing Applications). Once released Mosaic quickly took off. It was the first application to make browsing the web truly accessible. Andreessen and team were confident this meant prestigious return offers running Mosaic development upon graduation. Instead, NCSA took back control of the project and put more “qualified” individuals in charge. Marc wasn’t happy about this and instead of returning to NCSA he decided to head west, to Silicon Valley.

This is where Andreessen met Jim Clark. Jim Clark was a Silicon Valley legend. He and several Stanford graduate students founded Silicon Graphics, Inc. SGI was famous for being one of first companies to do 3D computer graphics. They were responsible for making the cutting edge graphics in Jurassic Park possible. After some time at SGI Jim Clark decided he wanted to move on. Clark sought out Andreessen and together they started Netscape. Andreessen recruited many of the engineers from the original Mosaic team and Clark provided the adult supervision with initial financial backing. Netscape was founded in April 1994. Their flagship product was Netscape Navigator a rebuilt browser that continued Andreessen’s original vision for Mosaic. In true dotcom style they IPO’d just 16 months later on August 9th, 1995. In the first day the stock price was opened at $28 and closed at $58.25.

Andreessen thought that Netscape Navigator needed a programming language to enable more interactive experiences. Brendan Eich went to work and in 10 days developed the first prototype of the language, named Mocha. The name Mocha was then changed to LiveScript, and once Netscape received a trademark license from Sun Microsystems (the creators of Java) they name was finally changed to JavaScript. Not to be confused with Java, which other than a few syntactic similarities, shared nothing in common with JavaScript. It may be hard to believe, but at the time the time Java was considered a hip programming language, and Netscape thought they could ride some of the positive PR by naming their language JavaScript.

Within a year or so Microsoft had their own implementation of JavaScript named JScript. The two competing languages led to more fragmentation in the ecosystem. All of a sudden webpages could either be optimally viewed in Netscape Navigator or Internet Explorer, but not both. With Microsoft’s market power IE won out, but before Netscape went down they worked with ECMA to help create a standard called ECMAScript. ECMAScript is the standard that JavaScript is built off of.

In 1999 ECMA released ECMAScript 3. This was a momentous occasion in the history of the internet. Now the browser vendors had a standard they all agreed on. Since all vendors were using the same standard there was far less fragmentation. Now webpages could be viewed similarly in any browser.

While ECMAScript 3 was released in 1999 there was about a 10 year gap until the next real standard was released. ECMAScript 4 was abandoned because it was two complex and would break backwards compatibility. During that decade there was no innovation in JavaScript langugae/ECMAScript standard. However the tools around JavaScript quickly evolved.

In 2005 Jesse James Garret coined the term AJAX. AJAX is short for Asynchronous Javascript and XML and it is a collection of tools that came out of Google for making asynchronous request to a web server for create more immersive user experiences. The first major website to use it was Google Maps. Before AJAX every time there was a need for a new HTTP request the whole page had to reload. This was a disaster for user experiences. Applications like Google Maps would be impossible without AJAX. Imagine if whenever you used Google Maps every time you zoomed in/out too much or searched for a restaurant the entire page had to reload. The product would be unusable. AJAX opened doors for a new class of web applications.

In 2008 the Google did it again when they released the V8 JavaScript engine. It brought huge performance improvements and made JavaScript even more accessible. Using the V8 Engine Ryan Dahl released Node.js in 2009. This took JavaScript out of the browser for the first time and allowed developers to run JavaScript code on the server. With Node.js/V8 a new class of back-end frameworks and other server-side application were made possible. For the first time ever developers were free to use JavaScript for the entire stack.

After the botched ECMAScript 4 was abandoned, finally, in 2009 ECMAScript 5 was released. In that decade between standards JavaScript performance improved by 100x, AJAX allowed for a new experiences on the web, and Node.js created a server side environment to write JavaScript applications. With the massive performance improvements and new tools JavaScript was finally becoming a language for getting real work done.

Today JavaScript is one of the fastest growing programming languages. ECMA has converted to a yearly release cycle of their scripting standard. ECMAScript 8 (A.K.A. ES8 or ES2017) is currently being worked on as we speak. According to Redmonk, who ranks languages based on lines of code in GitHub repositories and StackOverflow tags, JavaScript is the number one programming language. Projects like Electron are allowing companies like Slack to build cross platform desktop applications with the familiar web technologies JavaScript, HTML, and CSS. The React Native project is even make it possible to build native mobile applications using JavaScript and React.

You may have noticed that JavaScript’s history is full of a lot of turmoil. The language was designed in 10 days. Then there were competing versions for awhile. It took a few years for a unifying standard. Then it took a decade for the next version to be released. On top of all of that ECMAScript has always been made to be backwards compatible. One of ECMA’s rules is “don’t break the web.” This is why JavaScript doesn’t have the traditional version scheme that languages like Python have (i.e. 3.5 vs. 2.7). The reasoning behind this is that everything is backward compatible so theirs no need for versioning. Backwards compatibility also means that any mistake in the language design are stuck there.

For example, for a long time there were no block level variables in JavaScript. This meant that if you declared a variable inside of a for-loop or any block statement then said variable exist outside of that statement. So you end up with things like this:

for(var i = 0; i < 10; i++){
// do nothing
}
console.log(i == 10) // true

In most other languages the variable “i” will be garbage collected once you exit the for-loop, but not JavaScript. In order to amend this ES6 adds the “let” keyword; so developers could once again write sane code:

for(let i = 0; i < 10; i++){
// do nothing
}
console.log(i == undefined) // true

While developers should be thankful for the “let” keyword as a way to rectify the “var” mistake, in languages with versioning the rules for “var” could be re-written. Instead of introducing a new “let” keyword. But remember with ECMAScript you can’t “break the web.” If the standard for “var” had been rewritten it would wreck backwards compatibility and break a lot of the code on the web. The only way to fix it was to add a new feature in the form of “let.”

JavaScript’s biggest problem is that it’s becoming a programming language with a hodgepodge of features. It’s technically a object oriented programming language, but for a long time it didn’t have classes. Instead developers had to declare functions and resort to best practices for inheritance. Then ECMA add the “class” keyword to declare classes, but JavaScript classes still have their quirks because they’re based off of the languages model of prototypical inheritance.

It’s becoming popular now to treat JavaScript as a functional languages, because it’s possible to pass functions around as arguments. This is cool, but now developers are mixing functional programming with object oriented programming, which can quickly become messy. On top of all this everything is loosely typed, so a variable can be a Number in one part of the code and a string in another. This leads to possible run-time errors that are nonexistent in strongly typed languages.

JavaScript’s madness is why there’s so many libraries and packages in the JavaScript community. There seems to be 10 different libraries for solving any one problem. There is also a strong need for JavaScript variants. Languages like TypeScript try to fix problems that JavaScript has by allowing developers to write code that will then be transpiled to JavaScript so it can still run in the browser. There’s also CoffeeScript, Elm, and Dart to name a few. All of which are programming languages that aim to solve some of JavaScript’s deficiencies.

JavaScript is one of the coolest languages out their, but the JavaScript community is full of chaos. There are lots of competing frameworks. Then within the framework their are competing opinions on the best practices and ways to write applications. It can be overwhelming at times for newcomers and experienced developers alike. That being said there is a lot of innovation happening inside the JavaScript community. Few languages have the kind of reach that JavaScript does. JavaScript runs in any web browser and therefore has a built distribution model with billions of users. At the end of the this what you get when a language is designed in 10 days and has commited to backwards compatibility. Opposed to say a language like Clojure. Which, Rick Hickey spent 2 1/2 years working on before publicly releasing Clojure. All that being said there are few languages with more momentum than JavaScript right now. I think it’s safe to say JavaScript is going anywhere anytime soon and it’s language every developer should be familiar with.

--

--