Brendan Eich invented the JavaScript language in Netscape in 1995. It was the most misunderstood language in the past few years. With the development of AJAX and Web 2.0, people gradually face up to JavaScript. This is an interview with Brendan Eich by Computerworld, which describes the past, present, and future of JavaScript.
What prompted you to develop JavaScript?
For the early history of JavaScript, I wrote in my blog: http://Weblogs.mozillazine.org/roadmap/archives/2008/04/popularity.html
I joined Netscape in April 4, 1995 with the goal of embedding Scheme or similar languages into Netscape browsers. I joined the Netscape Server team because my application failed. This team is responsible for the development of Web servers and proxy servers. I have been working here for a month, this service is mainly used for the development of next-generation HTTP. By the time of March, I was transferred back to the Client team I wanted to join, and then I started the development of JavaScript prototype.
Marc Andreessen and I, along with Bill Joy, who works at Sun, firmly believe that HTML needs a scripting language that can be easily used by beginners and end users, in addition, the code in this language can be directly written between HTML tags and published as part of the webpage in the form of source code. This belief has also become our motivation. We plan to develop a "glue language" for website designers and programmers working part-time on website development to replace the previous method of building websites through images, plug-ins, and Java applets. We regard Java as a component language used by high-paying programmers, and glue programmers, who are web designers, will combine components through JavaScript to achieve interaction.
In this sense, JavaScript should be similar to Visual Basic in the programming language family used in Microsoft's operating systems and applications, while Java and C ++ are similar. The division of labor that runs through the programming language pyramid promotes more innovation, so that we can choose a "real" programming language like Java and C ++, you can also select some "small" scripting languages, such as JavaScript.
Have you encountered any special problems that need to be solved?
Unprogrammable web pages are static, with texts piled up. At best, images are placed in tables or floating on both sides of the web page. Using scripting languages like JavaScript, we can control elements on the web page, change their attributes, and respond to events. We can imagine that such a more dynamic network can only achieve the effects of previous applications through some web pages.
In fact, some early developers have been using JavaScript and framesets frameworks to build Web applications since the second half of 1995, this should be the earliest Web application in the "Ajax" or "Web 2.0" style. However, using this method will slow down the machine speed. JavaScript initially had a function library that operates the browser, but this library has limited functionality. The communication method with the server is also limited to re-loading the entire web page.
JavaScript and Java are essentially irrelevant, but why should we give it a name?
Through the above link, you can find the answer in my blog.
What is the initial JavaScript name Mocha and LiveScript based on?
Mocha is the project name from Marc Andreessen, but the marketing department of Netscape finds that this name has a potential trademark conflict, so it decides to enable a new name externally, they enabled the prefix "Live" For Netscape Product names, such as LiveWire and LiveScript. However, at the time, Java had a very strong development momentum, so we decided to stick to it and change the name to JavaScript.
What is the difference between JavaScript and ECMAScript?
The third edition of ECMA-262 is the latest version of the ECMAScript standard. The first version was developed based on my work achievements at Netscape, while absorbing the reverse engineering results of JScript Microsoft on the IE platform for JavaScript, it also includes Borland and a few other companies.
The third edition of ECMA-262 clearly allows for a variety of extensions, JavaScript can do much more than the standard, the language evolution has come before the current implementation of standards. For example, Mozilla's SpiderMonkeySpiderMonkey is also the JavaScript engine in Firefox) and Rhino engine.
Ecma standards only describe the core language, excluding DOM. We will still treat DOM as a part of JavaScript.
Do you think JavaScript and JScript are two terminologies that can or should be replaced with each other?
When this language is mentioned in cross-browser documents and books, no one will use JScript. JavaScript is the name used in these books, documents, reference manuals, etc. Whether you think the name is good or bad, JavaScript is the real name of the language.
During JavaScript development, have you ever encountered any problems that must be met and are especially difficult or annoying?
After the language design phase is frozen, every small development cycle is primarily designed to test the idea. In March 1995, May, I spent about 10 days developing the interpreter, including other built-in objects except the Date object. During this period, Ken Smith of Netscape used the C language to rewrite Java's java. util. Date class. The millennium Bug of this class was accidentally brought into JavaScript.
In the remaining days of 1995, my job was to embed this engine into the Netscape Browser and create a very famous DOM Document Object Model later.) The accuracy should be 0th levels of DOM, at this time, you can control objects such as Windows, documents, links, and images through a series of function interfaces in JavaScript, and respond to events and run code through timers.
Before the middle of 1996, I was the only one in Netscape who was working on JavaScript development.
Which of the most interesting programs you have ever seen written in JavaScript?
TIBET is an ambitious framework that imitates Smalltalk in the early days.
Currently, many programs written in JavaScript are amazing. For example, HotRuby can see more content here. This program allows users to run Ruby code in a browser using JavaScript. Some people also use JavaScript to implement a Java virtual machine called Orto. here we can see more information. Note that I'm not sure how many functions Orto actually implement on java virtual machines, but it is said that this is a very good program.
There are also many games written in JavaScript, some of which are newly developed and transplanted from other platforms, such as the following two:
Http://blog.nihilogic.dk/2008/04/super-mario-in-14kb-javascript.html
Http://canvex.lazyilluminati.com/83/play.xhtml
Processing Visualization Language transplanted by John Resig is the best Language I think.
Which of the worst ones have you ever seen?
I may not find the worst JavaScript program. But in the past, JavaScript was mainly used for pop-up windows, scrolling text in the status bar, and so on. A good browser like Firefox provides user controls with default values to implement functions. Netscape should do the same in the beginning so that JavaScript will not be abused.