It seems that in the web development world of the last couple decades, one language reigns supreme: Javascript. But, where did it come from? What caused such a meteoric rise? Why are companies today crying out for front-end developers well-versed in Javascript?
It would seem that Javascript is nearly ubiquitous on the web these days. Indeed all modern web browsers support Javascript, which means that late comers like myself can easily pick up some basic rules about the game and head out onto the pitch to test our mettle. That's a football reference, and yes, I'm talking about real football even though I'm an American...but I digress.
The story of how Javascript became the dominant language of front-end web development follows the story of an early web browser called Netscape Navigator. In the 1990s, Netscape was the dominant web broswer provider serving almost 90% of the market. By the mid 2000s, with other browsers competing for market share, Netscape faded into the background before current dominant browsers like Firefox, Internet Explorer, Safari, and my personal favorite: Chrome. Yet the popularity of Javascript, the language developed by Netscape to support their browser, survived in the next generation of browsers.
Though Javascript owes its rise to the forefront of programming languages to the popularity of its original host web browser, there must be something in the language itself that has allowed its proliferation across the web.
Quite simply, Javascript has survived because it's fast, relatively easy to learn in terms of programming languages, and due to it's initial and ongoing popularity there is a huge support community of resources for learning and writing Javascript.
The reason Javascript is fast is that because its an interpretive language it does not need a compiler to run. A compiler is simply a program that reads code and puts some output to the browser console or to the command line. Additionally, Javascript is executed on the client side which means that the code is interpreted directly in the user's browser and does not need to communicate with the web's server. This saves bandwidth and time.
Javascript's relative ease on beginners is due to a few factors. It is worth noting that Javascript is easier to learn when a user is already familiar with other Object Oriented programming languages such as Ruby or C. For example, I started in Ruby and many of the methods and syntax principles transfer across both languages with only subtle differences here and there. However, such a background is not entirely necessary, and many beginners learn Javascript as their first programming language.
One of Javascript's strengths is that it's what's known as a high level scripting language, which means two things. First, Javascript has a high level of abstraction. On a scale from bits of 0s and 1s to human language, Javascript tends to fall more towards the human end of the abstraction spectrum relative to other programming languages. That is not to say that programming languages are remotely close to human language in terms of complexity, creativity, context, and flexibility but that it's easier for humans to read the second image than the first.
Secondly, javascript is a scripting language which means that it supports scripts, or real-time interpretation of tasks in a web environment. Typically, this means that using a standard HTML framework and a CSS style sheet from a static website, script tags can be written directly into the html file to add dynamism to the web page. This allows the user to actually interact with the website by adding content, altering content, moving content, or any number of interactive functions.
The fact that so much of the web these days in based in Javascript means that one need only learn the basic syntax before being able to upload code directly to a favorite browser for the code to be interpreted. This makes learning Javascript even easier. No command line crash course, fancy text editor, or compiler set up necessary. Just open a new tab and hit Command + Option + J to open up the browser console and paste your code. There are also other ways to do this so if you're not a Mac user, don't worry. Just google it!
Like any programming language, however, Javascript has its drawbacks. Some criticize its need for curly brackets for blocks of code and semicolon use for statements. Sometimes a missed semicolon doesn't matter, and sometimes it causes the code to fail. One of Javascripts strengths is its attempt to interpret code using a set of rules. This can allow for some creativity and ease on beginners who make simple errors, but can also make it harder to debug. Whereas Ruby might just immediately throw and error message and a line number when something is written incorrectly, Javascript might actually run the program, albeit in an unintended way. Another drawback is that though Javascript is supported by various modern web browsers, they don't always render Javascript in the exact same way despite standards and rules of usage. This means that the same code might appear different on two different web browsers.
Coming Soon!