代码改变世界

【translate】JavaScript: The Definitive Guide, 5th Edition - (1)

2009-02-19 22:46  蜡笔小旧  阅读(270)  评论(0编辑  收藏  举报

Section 1.1. What Is JavaScript?

JavaScript is the subject of a fair bit of misinformation and confusion. Before proceeding any further, it is important to debunk two common and persistent myths about the language.

1.1.1. JavaScript Is Not Java

JavaScript不是Java语言

One of the most common misconceptions about JavaScript is that it is a simplified version of Java, the programming language from Sun Microsystems. Other than an incomplete syntactic resemblance and the fact that both Java and JavaScript can provide executable content in web browsers, the two languages are entirely unrelated. The similarity of names is purely a marketing ploy by Netscape and Sun (the language was originally called LiveScript; its name was changed to JavaScript at the last minute). However, JavaScript can, in fact, script Java (see Chapters 12 and 23).

 关于JavaScript流传最多的就是他是一个简化版的Java,这种语言由Sun公司开发。语法不完全相似并且Java和JavaScript都能在游览器中执行,这两种语言完全无关。相似的名字只是因为Netscape 和 Sun的市场营销策略;(这种语言最初的名字叫做LiveScript,其改名为JavaScript在最后一分钟).然而,

1.1.2. JavaScript Is Not Simple

JavaScript 是不简单的

Because JavaScript is interpreted instead of compiled, it is often considered a scripting language instead of a true programming language. The implication is that scripting languages are simpler and that they are programming languages for nonprogrammers. The fact that JavaScript is loosely typed does make it somewhat more forgiving for unsophisticated programmers. And many web designers have been able to use JavaScript for limited, cookbook-style programming tasks.

由于JavaScript是解释执行而不是编译执行的,它通常被看成一种脚本语言而不是真走的编程语言。这就意味着,脚本语言是简单的 ,{他的编程语言为nonprogrammers}。事实上,JavaScript是松散类型的语言,使得编码可以变得更宽松.许多web开发人员能够有限的使用JavaScript 烹饪式的完成编程任务 。

Beneath its thin veneer of simplicity, however, JavaScript is a full-featured programming language, as complex as any and more complex than some. Programmers who attempt to use JavaScript for nontrivial tasks often find the process frustrating if they do not have a solid understanding of the language. This book documents JavaScript comprehensively so that you can develop a sophisticated understanding. If you are used to cookbook-style JavaScript tutorials, you may be surprised at the depth and detail of the chapters ahead.

表面看起来很简单,然而,JavaScript是种功能齐全的编程语言,{as complex as any and more complex than some和其他语言一样复杂}。程序员试图完成已写简单的任务常常都不行,因为他们没有完全理解这门语言。此书详细讲解了JavaScript,可以提升你对这门语言的理解,如果你用他来你的JavaScript,你或许会惊讶予其中的深入与纤细.

edit 2009-03-19