Most programming languages contain good and bad parts, but JavaScript has more than its share of the bad, having been developed and released in a hurry before it could be refined. This authoritative book offers a detailed explanation of the features that make JavaScript an outstanding object-oriented programming language, and warns you about the bad parts.
In the process, JavaScript: The Good Parts defines a subset of JavaScript that's more reliable, readable, and maintainable than the language as a whole. Author Douglas Crockford, a member of JavaScript 2.0 committee at ECMA, is considered by many people in the development community to be the JavaScript expert.
A beautiful, elegant, lightweight and highly expressive language lies buried under a steaming pile of good intentions and blunders, he explains. The very good ideas include functions, loose typing, dynamic objects, and an expressive object literal notation. Awful ideas include a programming model based on global variables. With JavaScript: The Good Parts, you can release this elegant programming language from its old shell, and create more maintainable, extensible, and efficient code.
The book's topics include:
* Syntax
* Objects
* Functions
* Inheritance
* Arrays
* Regular expressions
* Methods
* Style
* Beautiful features
Appendices summarize JavaScript's bad parts and awful parts. But the greatest benefit of studying the good parts is that you can avoid the need to unlearn the bad parts. If you want to learn more about the bad parts and how to use them badly, consult any other JavaScript book.
JavaScript is the language of the Web -- the only language found in all browsers -- so avoiding it altogether is not an alternative. But, whether you're managing object libraries or just trying to get Ajax to run fast, Crockford's guidance in JavaScript: The Good Parts will help you create truly effective JavaScript code.
Douglas Crockford is a Senior JavaScript Architect at Yahoo!. He is the maintainer of the JSON format, and a regular speaker at conferences on advanced JavaScript topic. He is also on the JavaScript 2.0 committee at ECMA.
Weallfindthegoodpartsintheproductsthatweuse.Wevaluesimplicity,andwhensimplicityisn’tofferedtous,wemakeitourselves.Mymicrowaveovenhastonsoffeatures,buttheonlyonesIusearecookandtheclock.Andsettingtheclockisastruggle.Wecopewiththecomplexityoffeature-drivendesignbyfindingandstickingwiththegoodparts.Itwouldbeniceifproductsandprogramminglanguagesweredesignedtohaveonlygoodparts.
——引自第100页
不像许多其他语言,JavaScript中的代码块不会创建一个新的作用域,因此变量应该被定义在函数的顶端,而不是在代码块中。
——引自第10页
冯象,上海人。少年负笈云南边疆,从兄弟民族受“再教育”凡九年成材,获北大英美文学硕士,哈佛中古文学博士(Ph.D),耶鲁法律博士(J.D)。现任北京清华大学梅汝...
汉宝德,1934年生,国立成功大学建筑学士,美国哈佛大学建筑硕士及普林斯顿大学艺术硕士。曾任东海大学建筑系系主任、中兴大学理工学院院长、国立自然科学博物馆馆长、...
Haveyoueverponderedwhysometroubledmarriagessucceedwhileotherseeminglyfairytale"m...
保罗•策兰(Paul Celan 1920-1970)二战以来影响最大的德语诗人;1952年,其成名作《死亡赋格》震撼德国;1960年获德国最高文学奖——毕希纳...
郭敬明携手插画师年年,再次演绎属于浅川的“夏至未至”。落落、自由鸟、项斯微、萧凯茵等实力作家,融情怀旧。八篇青春故事,八种鲜活少年模样,让渺小的声音响彻至正在成...
《外国建筑历史图说》按照社会经济形态的不同,将外国建筑历史划分为三阶段——即:上篇农业社会建筑,中篇工业社会建筑和下篇信息社会建筑。在每一篇里又按照建筑历史的发...
产品数字化设计与标准化 内容简介 《产品数字化设计与标准化》是针对复杂产品数字化设计需求,针对产品数字化设计过程中遇到的标准化问题,为促进产品模型质量、产品数据...
作者简介Sunil Amrith is the Mehra Family Professor of South Asian Studies and Profes...
★击败两位布克奖得主,2019女性小说奖获奖之作!★比尔·盖茨2019冬季书单力荐!★全美热销50万册,美国前总统奥巴马将本书列入2018夏季阅读书单★2018...
作品目录第一部分 知识分子:自由市场的天然敌人? 知识分子与社会至上主义 工程师和计划者 资本主义与犹太人:探讨一个悖论 知识
前英國首相邱吉爾說:「民主是一種最不壞的制度。」歐洲及美國一直奉行民主制度,但近數十年,當這些民主國家出現政治及經濟危機,便有人質疑民主理念和民主制度,到底哪裏...
安藤 更生(あんどう こうせい、1900年6月10日 - 1970年10月26日)は、日本の美術史家。 東京出身。本名・正輝。東京外国語学校(現東京外国語大学)...
书中有灵气的诗句包括但不限于以下:*我的眼睛/很小很小/有时遇到心事/就连两行泪/也装不下——陈科全, 八岁*灯把黑夜/烫了一个洞——姜二嫚,七岁*春天来了/我...
雪小禅说,一年要很多次远行。只要能走,就一直在路上。看山川河流,看草木情深。去每个城市的街边、小巷中逛地摊、吃小吃,到八十岁依然坚持旅行。不惧怕光阴衰老,永远怀...
知识经济时代已经来临,不管是知识密集型企业,还是资本密集型企业,甚至连劳动密集型的制造企业.都在向“智造”转型。知识的创
豪尔赫•路易斯•博尔赫斯(Jorge Luis Borges,1899-1986)阿根廷诗人、小说家、评论家、翻译家,西班牙语文学大师。一八九九年八月二十四日出...
《健全的社会》是社会心理学领域的经典之作,是对现代社会中人的精神状况的一次有力的探索。精神健康的问题是否只涉及某些“不适应”社会的个体?社会作为整体是否会患上精...
铁路安全案例培训·机车车辆篇 内容简介 《铁路安全案例培训(机车车辆篇)》编写采用“案例回顾—知识点解析”的结构形式,选取案例典型真实,事故概况保持原貌,解析力...
全髋关节置换术并发症 内容简介 全面理解全髋关节置换术后的常见并发症,对于其预防是至关重要的。同样,全面掌握正确的治疗手段也是减少并发症致残率所不可缺少的。这本...
精彩摘录”多数做妻子的都有一个大毛病,老觉得她们的丈夫是奇货可居的任务,生怕被别的女人抢了去。其实没有这种事,只要她们信自己。——引自章节:-我欣赏他,一个男人...