A Brief History of JavaScript
JavaScript was originally written to be run inside of the Netscape web browser in order to offer client-side form validation. It is now an internationally recognized standard, but its history is based in the browser wars, and some of the consequences of this are still evident in the language today.
Here are some resources for more information about transpiled languages:
- CoffeeScript: A little language that compiles into JavaScript
- TypeScript: An open-source language which builds on JavaScript by adding static type definitions
- Dart: An object-oriented language with C-style syntax
Here are some resources for more information about topics covered in this lesson:
00:00 In the previous lesson, I gave an overview of the course. In this lesson, I will introduce you to where JavaScript came from and how it has grown over time. In the beginning, there was Usenet, and lo, Tim Berners-Lee looked out upon that creation and said, “I can do better.” Sir Berners-Lee, then known as Tim as he hadn’t been knighted yet, worked for the European physics research group CERN.
00:24 He wanted a better way of being able to join text, images, and interlinked documents in order to present physics papers. The result was the WorldWideWeb, one word, and confusingly, the name of both the software and the virtual space. Quickly, to avoid confusion, the browser was renamed Nexus.
00:43 Not long after, browsers started popping up everywhere, one of which even still survives today. The text-based browser Lynx is still readily available in most of the major Linux distributions. Nexus was released to the public domain on April 30, 1993.
01:01 Things truly took off with the introduction of NCSA Mosaic. This was created at the National Center for Supercomputing Applications at the University of Illinois.
01:11 This browser was graphically based and the first to include inline images. Prior to this, you had to click an image icon to open it up in a separate viewer.
01:21 One of the NCSA Mosaic programmers was Marc Andreessen. After he graduated, he moved to California, where he met Jim Clark, an ex—Silicon Graphics founder, and they created Mosaic Communications.
01:33 The University of Illinois was rather unhappy with this name, so the company was renamed to Netscape Communications. The Netscape browser was the first commercially successful web client.
01:44 Internally, it was codenamed Mozilla—spoiler alert! For years, it was the technical leader and introduced features such as on-the-fly displaying of a page, cookies, frames, and a built-in programming language named JavaScript.
02:02 In September, 1995, a programmer at Netscape named Brandan Eich wrote JavaScript in just 10 days. It was originally called Mocha, then LiveScript, then finally, JavaScript.
02:15 JavaScript’s first intent was to perform client-side form validation in the browser. There’s been much confusion over the years between Java and JavaScript.
02:24 I still occasionally run into non-programmers who do not realize these are different things. Java is a compiled language, whereas JavaScript is interpreted at runtime. In the early days, Java was considered a business language for developing applications, whereas JavaScript was there as a UI glue. Netscape decided to have JavaScript standardized and approached the W3 Consortium that was responsible for most of the web standards. They were turned down.
02:50 So then they approached the ECMA. Thus was born ECMAScript.
02:56 JavaScript is now actually just one of several implementations of the standard language called ECMAScript. Other implementations include the scripting language that Flash was based on.
03:08 Over the years, companies fought for browser dominance, both constantly adding features to the language and the browsers. In the early days, Microsoft and Netscape battled it out. Eventually, Netscape died.
03:21 Parts of their codebase was open-sourced. The Mozilla Foundation was formed, building Firefox out of the ashes of Netscape’s demise. There are still many web browsers out there, and although some share some underlying code, there are still also many underlying JavaScript engines.
03:38 This can cause compatibility problems.
03:41 The ECMAScript standard and the JavaScript implementation continue to evolve. This compounds the compatibility problem, as you can’t assume a feature you want to use exists unless you know exactly which browser you are targeting.
03:55 A lot of big changes happened in the ECMAScript 6 release. This was introduced in 2015. This version has fairly wide adoption. Programmers writing JavaScript for the web often assume this as their base. ECMAScript 11 was published in June 2020.
04:13
The main feature from this version is BigInt
, and it has been implemented in Chrome, Firefox, Edge, and Safari. Some of the mobile browsers don’t support it yet, and if your users are still on IE, you are out of luck.
04:25
A great site for figuring out what web features you can take advantage of is CanIUse.com. There’s a link in the notes below. It will show you a breakdown of which browsers support any given feature and what percentage of the global population that covers. At the time of this recording, the ECMAScript BigInt
feature was usable by almost 90% of the world.
04:48 JavaScript isn’t confined to the web anymore. The Node.js JavaScript runtime has become quite popular. Being able to run JavaScript on both the client and server is a strong advantage. For example, any data validation code you write can be used at form entry and on the server, allowing you to do client-side validation and server-side verification—an important requirement for security. In addition to server-side use, there are also transpiled versions of JavaScript.
05:18 A transpiled language is one that, instead of being compiled, is translated into another language. Because JavaScript became the de facto web language, many programmers who found it frustrating wrote new languages, which instead of requiring a new runtime, would be transpiled.
05:35 One of the more popular transpiled languages is TypeScript, which was the inspiration for Python’s type hinting mechanism. Every language steals the good ideas from every other language.
05:45 That’s how they all get better!
05:48 Enough talking, let’s code. Next up, I’ll give you a whirlwind intro to JavaScript in the browser.
Become a Member to join the conversation.
Jordan Bell on Aug. 28, 2024
Sir <first_name> is the proper address, I think