开发者

Why don't we just stop using the word JavaScript, in favor of ECMAScript?

The question say开发者_Go百科s it all.


There is a difference between ECMAScript and JavaScript, isn't there?

ECMAScript is a well-defined language (spec here).

JavaScript is a dialect of it, not a full implementation as far as I understand, plus it contains what five generations of browsers did to it.

As Christoph points out in his comment, Microsoft's implementation of ECMAScript is actually called JScript, and the word "Javascript" is licensed to the Mozilla foundation.

The general perception, I think, is that of JavaScript as the sum of every browser's implementation of ECMAScript. It would be horrendously confusing to change that, and factually incorrect.


Say your question out loud and you will find it is its own answer.

If you spell it out then the five syllables of EEE-SEE-emm-EH script are quite a mouthful. And if you attempt to pronounce it as a word it will come out sounding like EczemaScript, which will lead to a rash of jokes.

Besides, "JavaScript" is the more than just widely used, it is embedded. No way are you going to be able to stop people saying "JavaScript".

edit

By a spooky coincidence I have just watched the Steve Yegge keynote from the OSCON 2007, in which he talks about branding and software. He touches on the issue of JavaScript vs ECMAScript. Without reaching a conclusion, it's true, but Steve is always good value. Watch it now.


The history of why it is called JavaScript is a convoluted one, and has a lot to do with making developers comfortable with the new language.

It was originally Mocha, then LiveScript, and finally JavaScript. Calling it JavaScript probably has a lot to do with why it was so widely adopted, as people assume it is similar to Java, and other C family languages that most programmers use every day. It actually has much more in common with Scheme and some of the more esoteric prototypal languages.

JavaScript is a well specified language, and is surprisingly well implemented accross all browsers. There are elements of the spec that cause major headaches, such as semicolon inference, but these are pretty consistent with the spec across all implementations.

It is the DOM library that causes 99% of the headaches with cross browser implementations in the real world.


As an addendum to the other answers:

  1. HTML specs suggest using the text/javascript MIME type:
    <script type="text/javascript">

  2. Usually ECMAscript files are saved with file extension .js


Because ECMAscript is the standard and Javascript is an implementation (albeit a massively fragmented implementation). Which does not wholly support ECMAscript.


Because JavaScript Was its name (granted by Netscape) many years before Microsoft pushed through standardization by ECMA in an attempt to legitimize their independently developed JScript.


Historical reasons. Even if JavaScript™ is actually only the name of the ECMAScript dialect maintained by the Mozilla Foundation, I use the term Javascript (no capital 's') to encompass all common ECMAScript dialects.


Because ECMAScript is a name which refers to the language standardized by ECMA. JavaScript/JScript is one dialect of the language, but it's not the only one. There are other dialects like ActionScript. So the term "ECMAScript" doesn't only refer to JavaScript/JScript but also other dialects like ActionScript which are NOT what is embedded into browsers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜