An ex-coworker and colleague of mine invited me recently to a Typescript meetup at his company, after hours.
I didn’t really have much going on that evening and decided it might be worth attending, so I agreed.
Two hours later, my mind was blown. The topic of the presentation was actually a little deceiving. Yes, it was a Typescript meetup, but in actuality, the presentation was really about the current state of Javascript and how it’s evolving into an extremely powerful programming language.
What amazes me is the journey Javascript took in order for it to be so relevant in today’s software development landscape.
To appreciate why I feel it’s so amazing that Javascript has survived and thrived to this day, it’s necessary to understand it’s humble beginnings.
Javascript was introduced in 1995, which wasn’t many years since the introduction of the Internet as we know it today…maybe 2 years from the time the world’s first internet web browser, Mosaic, was introduced to the world.
I clearly remember the introduction of Mosaic, in a computer lab at my college, during my junior year. I remember hearing someone at my college, mentioning the word “Mosaic”, and describing it as a new way of querying information from a computer … I even remember her mentioning it was a groundbreaking new product.
But I was already pretty jaded about technology, even back then. I grew up on 8 bit Apple IIs, Commodore 64s and TRS-80 computers as a kid. I felt very comfortable being around computers and technology at a young age.
But when I launched Mosaic for the very first time in our college’s computer lab, on one of their Macintosh computers, I was hooked. When I started clicking around on various hyperlinks, which took me to different websites and web pages (the Internet was a much SMALLER place back then, but even so…), and I was completely blown away.
We take the internet for granted today, but I’m actually appreciative of the fact I’m part of a generation that knew what life was like BEFORE the advent of the Internet.
Sure, computers were around for many years before the Internet, but they weren’t very CONNECTED to each other. Oh sure, they were connected, but at a very primitive and slow level.
When Mosaic came out, it suddenly was a snap to hop from one computer to another, even ones thousands and thousands of miles away. All it took was a mouse click, and BOOM! You could “surf” the internet, much in the way one could “channel surf” your television and see what’s on.
But back then, websites were very “static”. Meaning that early web pages and websites were mostly just static documents and images in electronic format. You would fire up Mosaic, type in an internet address, and your browser would start downloading the html files and images from the web server from that internet address.
And that was it. There wasn’t much interaction you, as the web user, could do, once you were there. Oh sure, there were HTML forms where you could fill out information, much like a paper application form, but that was about the extent of interactivity around that time.
It wasn’t until an up and coming company called Netscape, headed by Marc Andressen, created a commercial version web browser (and yes, Netscape actually charged MONEY for the browser, as their primary profit driver…when was the last time anyone remembers PAYING for an internet browser??).
And that’s when web sites started becoming interesting. Not longer after Netscape introduced the first commercial web browser to the world, around version 2.0 of their software, they introduced a new little scripting language called Javascript.
The original purpose of Javascript was to make boring old static HTML pages more dynamic and interesting. Before Javascript, it was basically impossible to change anything about a static HTML page once it has been served up by the web server and downloaded to the client’s browser.
Say you have a web page that contains an online registration form for potential customers to sign up for some new upcoming product release.
The web form asks for information such as the person’s full name, their mailing address, phone number and e-mail address and other various pieces of information needed from the potential customer.
Before the advent of Javascript, a client side web page would need to make a full round trip to the web server, process all the information submitted from the web form, and then return a response back to the browser.
So what would happen if the potential customer forgot to fill out their phone number or some other critical piece of information needed from the form?
The potential customer would need to wait until the full round trip to the web server and back to the client browser would need to complete, before the customer could fill out the missing information and resubmit the form back to the web server with the additional required information they forgot in the original submission to the web server.
Sure, this works, but it’s a very time consuming process, waiting for the registration form information to reach the web server, get processed, and then returned back to the client browser.
What if you could VALIDATE all the information the online registration form needed BEFORE it gets submitted to the web server?
This was one of the useful things Javascript allowed you to do to static HTML pages. Javascript gave you the ability to begin treating HTML websites more like dynamic software applications. It kicked off the era of web based application development.
Over time, Javascript continued to evolve. For some years, it went through a sort of “rough patch” where the Javascript language became a turf war between Netscape, the company that introduced the Javascript language, and Microsoft, the company that considered Netscape a threat to their Windows operating system and Office productivity software dominance in the PC industry.
Microsoft wasn’t about to allow an up and comer upstart like Netscape to threaten their near monopoly of Windows and Office software. In fact, Microsoft felt so threatened by Netscape and the rising popularity of Javascript and web based software development, that they created their own version of Javascript called Microsoft JScript.
For some years, both companies continued to develop their own “flavors” of Javascript, each competing for software developer “mindshare”. Microsoft didn’t want Netscape to call the shots about what went into future version of Javascript, and Netscape certainly didn’t want Microsoft to butt in into their original Javascript creation.
When you have two competing companies fight over the same piece of technology, in this case, Javascript, you run the risk of turning away software developers who don’t want to end up being in the middle of an intellectual turf war between two giant technology companies.
Web developers at the time, have already suffered through the same type of turf war between the same two companies, Microsoft and Netscape with the browser wars and their competing versions of HTML.
Software developers at the time, had to worry about competing HTML specs when building out websites AND to make it worse, different interpretations of Javascript as well.
Nobody in their right mind wants to have to create two more different versions of the same web application to work successfully under different browsers and javascript.
Javascript could have very well ended up dying away as a technology, due to all the infighting between tech companies.
Standards body committees like W3C and ECMA came to rescue by creating OFFICIAL standards of technology for the HTML and Javascript spec. This forced the hands of companies to adhere to these new standards, lest they lose the support of developers, who are the lifeblood of any technology … the more developers who use your technology, the less chance of dying away as an obsolete technology.
Over time, Javascript continued to evolve and become more powerful for web developers.
The next major revolution of Javascript came with the advent of AJAX. AJAX is short for Asynchronous Javascript and XML.
It represented a new way of making web based applications act more like traditional desktop based computer applications that require you to install something directly to your computer, such as a word processor application like Microsoft Word.
One of the first things you notice while using a plain, static HTML website, is that anytime you want to navigate around, such as by clicking hyperlinks within a web page, you are making a new full round trip to the web server that is hosting that website.
You see the web browser make a full page “refresh” which makes everything in the browser temporarily disappear while the browser waits for a new response from the web server to serve up the page again.
This is a very inefficient way to navigate around a website. It’s also very distracting to the end user and a very unpleasant user experience.
What AJAX allows you to do is to update only the portions of a web page that need to change, not the whole page. No longer does the user have to suffer and wait while the browser waits for a full page refresh, and you have a much smoother and enjoyable user experience that feels much more like a traditional desktop application.
Anyone who uses web applications like Google Maps and Google’s Gmail system, are taking advantage of AJAX driven applications. Once the browsers loads in Google Maps or GMail for the first time (which DOES take a full round trip to the web server, but only ONCE), you’ll quickly notice that the browser never has to do a full refresh again.
As you move around in Google Maps, you quickly notice only the portions of the map that have to change, will change. The same goes for GMail.
With the power of AJAX, suddenly web applications jumped in the caliber of quality of desktop class applications.
The third major Javascript revolution happened in 2009 with the advent of a new server side technology called NodeJS.
Up to this time, a typical web application consisted of two major layers:
- The front end user interface layer consisting of HTML, CSS and Javascript
- The back end layer containing some programming language/framework like Java, C#, perl, ruby, etc.
What NodeJS allowed you to do was write the back end layer code residing on the web server, in Javascript as well.
No longer does a web developer have to worry about learning two different programming languages to create a full stack web application.
Even better, with the advent of document based databases like MongoDB, Raven or CouchDB, a developer can use and incorporate Javascript to utilize those databases in their NodeJS applications.
Now you can use Javascript in all three major layers of a web application, the front end, the middle layer where all the application logic resides, and the back end database.
This, no doubt, explains the huge surge in popularity of Javascript in modern day software development. Javascript, which began as a simple client side scriptling language to help make static HTML pages a little more dynamic, has become a full blown programming language that is literally used by millions of software developers around the world.
The fourth major Javascript revolution, came with the transformation of Javascript to Ecmascript, which is the official new label for a standards based Javascript.
As mentioned before, the standardization of Ecmascript by a standards body steering committee means that software developers can use Javascript and no longer have to worry about different competing versions created by different technology companies.
More recent versions of Ecmascript like version 6 allow software developers to incorporate the use of object oriented concepts like classes. This will continue to help the wider adoption of Javascript by traditional object oriented programmers.
Other concepts like modules allow your javascript app to handle external dependencies to other libraries of code, a cinch.
Ecmascript is transforming the Javascript language into a truly fully fledged, flagshop quality class programming language in the ranks of traditional programming languages like C, C++, C# and Java.
There is no doubt in my mind that Javascript is here to stay and only growing more popular and widespread by the day.
It would behoove any software developer to throw away any preconceived notions of Javascript as just a “toy language for little websites”, and put the time and effort into learning the language.
The payoff will be possessing a long term, career spanning skill that won’t be going away any time soon.