Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

JavaScript: How it all Began

DZone's Guide to

JavaScript: How it all Began

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

This post presents a brief history of how Brendan Eich created JavaScript and what influenced its design decisions.
A company called Netscape was founded in 1994 and created one of the first web browsers. They recruited Eich in 1995, because they wanted him to create a programming language for that web browser. The lure for him was that he would be able to base the language on Scheme (a Lisp dialect). An initial prototype was indeed Scheme-based and that ancestry still shows in JavaScript’s support for closures. Another influence was the prototype-based programming language Self which is responsible for JavaScript’s prototypal inheritance (some of the elegance of this approach is hidden by JavaScript’s muddled adoption of it). Next, Java got included in the browser. It quickly gained popularity and influenced Netscape’s decisions regarding JavaScript. For example, its name:

Question by interviewer: As I understand it, JavaScript started out as Mocha, then became LiveScript and then became JavaScript when Netscape and Sun got together. But it actually has nothing to do with Java or not much to do with it, correct?
Eich’s answer: That’s right. It was all within six months from May till December (1995) that it was Mocha and then LiveScript. And then in early December, Netscape and Sun did a license agreement and it became JavaScript. [2]
Eich explained why Netscape thought two languages were needed, instead of just Java, and why JavaScript is embedded in HTML.
We aimed to provide a “glue language” for the Web designers and part time programmers who were building Web content from components such as images, plugins, and Java applets. We saw Java as the “component language” used by higher-priced programmers, where the glue programmers – the Web page designers – would assemble components and automate their interactions using JS. [3]
Netscape management also decided that JavaScript’s syntax had to look like Java’s. That ruled out adopting existing scripting languages such as Perl, Python, TCL and Scheme. It explains why JavaScript’s syntax changed from Lisp-like to Java-like.
Eich blames some of JavaScript’s idiosynchracies on having had to finish a prototype quickly which subsequently was changed little before being deployed. His favorite JavaScript features [4] are:
  • First-class functions
  • Closures
  • Prototypes
  • Object literals and array literals
Sources of this post:
  1. Brendan’s Roadmap Updates: Popularity
  2. JavaScript creator ponders past, future
  3. The A-Z of Programming Languages: JavaScript
  4. A Brief History of JavaScript

 

From http://www.2ality.com/2011/03/javascript-how-it-all-began.html

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}