Spelchan.com Logo

From Scratch Web Games: A Beginners Guide to Game Development using HTML, CSS, and JavaScript

Chapter 4.2: History of JavaScript

JavaScript is, whether you like it or not, the language used by browsers. While there have been attempts to add additional options, such as Microsoft trying to get a VBScript in the browser and Google pushing for Dart. These did not take off. Transpilers have had a bit more success with TypeScript being used by an increasing number of developers. Transpilers convert from one language to another, so ultimately you still have JavaScript running on the browser. I have hopes that Web Assembly (WASM) will improve to the point where any language can be used to generate modules for the web but that is the subject for another book.

This success should lead to the question “how did JavaScript come about?” This happened in the early days of web browsers when Netscape was still a dominating force in the browser wars. Sun was pushing their Java programming language wanting a version of it to be included in browsers. For those of you not familiar with Sun, they were predominantly a hardware manufacturer who developed servers and workstations. They were acquired by Oracle which is why Oracle owns Java and the trademark to JavaScript.

Brendan Eich had been hired to create a programming language for Netscape but with the push to include Java into the browser, Netscape decided that if they were going to have a scripting language as part of the browser it should be introduced in the same release as Java. This gave poor Brendan only 10 days to create JavaScript. Granted, the first version of JavaScript was far more limited that what we have today, but it is still an impressive achievement. The initial goal of this language was for it to be a simple glue language tying different parts of the page together. The original name of the language was Mocha, but there were trademark issues with that. They then went with LiveScript but discussions with Sun resulted in them calling the language JavaScript with Sun holding the trademark.

Needless to say, other browser venders created their own clones of JavaScript with different functionality and web developers had a huge headache on their hands. Netscape quickly decided to send JavaScript to a standards body so the European Computer Manufacturers Association (ECMA) was given control over JavaScript but due to the trademark held by Sun, named the standard ECMAScript. The ECMAScript standard was released in 1997. The second and third revisions happened in 1998 and 1999. ES4 was an attempt to add types to the language but was abandoned. Flash’s ActionScript 3 language was based on ES4 and I personally think abandoning it was a huge mistake. There was a long spell before anything happened to the language but in 2009 the language was revisited again with ES5. As JavaScript started to be used more for creating real applications rather than simple scripts the ECMA started releasing versions of the standard annually with the names becoming ECMAScript 20xx with the xx being the year the standard was released.

As is very common today, the standards are continually being updated. I am not too sure I am in favor of this approach and recommend that developers pick a version for a project and stay with that version until the project is done. Unfortunately, the concept of depreciation also exists so trying to stay with an older version can have the problem that features you use have been depreciated and will eventually vanish.

Some astute readers may have noticed that I said Java was in the browser. There was, for a time, an applet tag for including Java programs in the browser. The element was depreciated in HTML 4.01 and is no longer part of HTML. The move away from plugins means that if you are going to have any type of application running in a web page, it should be JavaScript (possibly with WASM modules to speed things up).

Programming is interesting as it borrows aspects from science, engineering, and art. As a result, there are many ways of accomplishing the same thing. This has resulted in many different methodologies on how to write a program. In the early days, we had procedural programming in which programs are written with one main block of code that may call subroutines. Object oriented programming adds the concept of classes and inheritance, which we will cover in a later chapter.

The core concepts behind procedural programming happen to be the core concepts needed for other types of programming so it makes sense to learn programming from a procedural methodology before going into other methodologies. The goal here is to make sure that you have enough programming knowledge to accomplish things. Future chapters will cover more advanced topics.

Chapter contents

Chapter 4 Contents

4.1 Cheat Sheets

A quick summary of the basics of JavaScript.

4.2 History of JavaScript

A brief look at how JavaScript was written in 10 days.

4.3 Comment Controversy

Comments. Why programmers don't write them, and how they should be written

4.4 Variables

Variables are used to store the state of a program.

4.5 (extra) How Computers Represent Data

Bits, Bytes, and data types.

4.6 Math

Math on the computer similar but some symbol differences.

Math functions

Various math operations can be used through the Math class.

4.8 Strings

Strings are what we call blocks of text and are used extensively.

4.9 Calculating true and false

Coming April 21st, 2024

4.10 Conditional expressions (if)

Coming April 28th, 2024

4.11 Nested conditions

Coming May 5th, 2024

4.12 Switch statement

Coming May 12th, 2024

4.13 Functions

Coming May 19th, 2024

4.14 Looping

Coming May 26th, 2024

4.15 Nested loops

Coming June 2nd, 2024

4.16 Accessing the Web page

Coming June 9th, 2024

4.17 Events

Coming June 16th, 2024

4.18 Project: Where’s Wendy

Coming June 23rd, 2024

4.19 Project: Where’s Wendy implementation

Coming June 30th, 2024


← previous section
JavaScript Basics Cheat Sheet
next section →
Comment Controversy
Table of Contents