Let s Talk Some More About JavaScript


Let’s Talk Some More About JavaScript

Now that you know why this book will use JavaScript to teach programming and why—everyone has it, it’s free, you can do neat things with it, it’s a modern programming language—let’s talk a little more about JavaScript.

Scripts vs. Programs

Because the name of the JavaScript language contains the word Script, it leads to the natural question “What is the difference between a script and a program?” Actually, there’s no difference. Officially speaking, a script is a program. However, the term script tends to connote a lightweight program, one that’s run in an interpreted rather than a compiled environment. (A macro is a term for an even lighter weight program than a script.)

It really doesn’t matter whether you call code intended for execution a macro, a script, or a program. I prefer to use the term program because it emphasizes the programmatic nature of the challenge involved. If you think of it as a program, rather than a script, your attitude may embrace the Zen necessary for proper planning and best coding practices. This attitude will help you be successful with JavaScript (or any other programming language). Besides, object-oriented scripting sounds like a bit of an oxymoron.

Understanding the History of JavaScript

Although JavaScript is a little bit Java-like, JavaScript isn’t Java and isn’t even Java’s cousin.

Netscape originally developed JavaScript in the mid-1990s under the name LiveScript. LiveScript was intended as an easy language for Web developers—including hobbyists—to add interactivity and movement to static HTML pages. The companion product LiveWire was intended for use on the server side to script connections between Web servers and back-end programs such as databases.

Netscape changed the name of LiveScript to JavaScript for marketing reasons. (You may recall that a few years ago any software name that bore any relationship to coffee was very cool.) This may have been a valid marketing decision, but it created considerable confusion in the marketplace. Netscape is still the official owner of the name JavaScript, which is why Microsoft’s version is called JScript.

start sidebar
Deciphering JavaScript, ECMAScript, and JScript

In the beginning, there was LiveScript, which became JavaScript. As such, JavaScript is a proprietary name for a language running in the Netscape browser. As noted previously, Microsoft developed its own version of the language under the name JScript that runs in Internet Explorer browsers.

The official, standardized cross-platform language is defined by the European Computer Manufacturers Association (ECMA) standard 262. (If you’re curious, you can find the full text of the standard online at http://www.ecma-international.org/.)

So, officially speaking, the name of the language in this book is ECMAScript 262. But everyone just calls it JavaScript —no matter what browser is interpreting it.

end sidebar




Learn How to Program Using Any Web Browser
Learn How to Program Using Any Web Browser
ISBN: 1590591135
EAN: 2147483647
Year: 2006
Pages: 115
Authors: Harold Davis

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net