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页
《医学伦理(中文版)》内容简介:安乐死是原则上错误的吗?在精神疾病患者不同意的情况下,可否对其进行强制治疗?绝经后的妇女是
史蒂夫·帕弗利纳 (Steve Pavlina)美国知名个人成长导师,美国加州州立大学计算机、数学双学位学士,曾经营游戏公司,后来转向个人成长领域的研究和实践。...
一本關於宿命、流浪與愛的小說。慶山(安妮寶貝)經典首本作品,金馬獎雙影后,周冬雨X馬思純,電影《七月與安生》原著短篇小說集,隆重獻映。少年的友情就像一隻蝴蝶一樣...
(英)詹妮弗•格雷(Jennifer Gray )这几年来为儿童创作了大量有趣的喜剧作品。她曾经当过多年的出庭律师,工作中的奇闻趣事带给她丰富的创作灵感,她于是...
天工开物图说 本书特色 《天工开物》是中国古代一部综合性的科学技术著作,有人也称它是一部百科全书式的著作,作者是明朝科学家宋应星。外国学者称它为“中国17世纪的...
作品目录初版题记修订版题记第一篇罗马第二篇(一)那不勒斯(二)厄尔古兰诺 庞贝(三)巴伊阿 波孰奥里 彼斯顿(四)奥斯提亚第三篇
《中国米食》是在《中国米食》(繁体字版)的基础上,结合当下之新变化,保留精华,尽力完善而成的。全书的设计分为“米粒篇”和“粿粉篇”两部分,米粒篇以朴素的饭团、粽...
2018本屋大賞第1名!「直木賞」名家最撼動人心的催淚神作!日本全國書店店員最想銷售的書No.1!勇奪日本7大獎榮耀!狂銷突破55萬冊!隨書附贈:狼少女 X鏡世...
编辑推荐作为女性眼里的*“男神”,拥有千万粉丝的巨星司凰,大家总会去关注“他”的一切。然而当世人发现男神竟然是个女人时……全民沸腾!*苏爽美型激萌的都市童话!暖...
赵宠亮,1982年7月生,河北省永年县人。2005年6月河北师范大学历史文化学院毕业,获历史学学士学位。2008年7月北京师范大学历史学院毕业,获历史学硕士学位...
【内容简介】疾病的真相是什么?生病了应该吃什么药?我们接种的疫苗是怎么来的?手术是怎样变得越来越先进的?从古至今,医者们为了医学发展做出了怎样艰辛的努力……《医...
生活在这个时代的我们,本该是幸福的,物质充盈、信息发达……然而,我们中的大多数人时常感到焦虑、烦躁、沮丧、难以专注,也因此丧失了对幸福的感知。清华大学心理学系主...
作品目录1开场白2格伦普3快速变形兽金尼4意外事情5克罗菲6大屁股扎思7ZABANGDRALDNK8格列切9设圈套10比贝利11是谁?12可怕的菲苏
作品目录引言 基督教在华传播史概述第一章 上帝教的创建第一节 洪秀全:从屡试不第到皈依上帝第二节 上帝降临广西:上帝教的问世
犬猫科学安全用药指南 本书特色 《畜禽养殖科学安全用药指南丛书:犬猫科学安全用药指南》适于兽医工作者和犬描养殖者阅读,也可以作为大专院校和农村函授及培训班的辅助...
◎内容简介《孤儿的新年礼物》是兰波创作的第一首诗,当时他不到15岁。之后的五年里他创作了大量传世佳作,却在19岁宣布封笔。兰波谜一般的人生只有短短37个春秋,有...
无可争议的侦探小说女王,侦探文学史上最伟大的作家之一。阿加莎•克里斯蒂原名为阿加莎•玛丽•克拉丽莎•米勒,一八九○年九月十五日生于英国德文郡托基的阿什菲尔德宅邸...
为什么有的国家银行体系非常容易发生危机,而有的国家非常稳定?比如美国自1840年以来银行体系发生了12次危机,而加拿大却从未发生过危机;墨西哥和巴西等国家的银行...
李敖说,这部《胡适评传》,不该单是胡适之个人的评传,它是时代的评传,它是以胡适为主角之一的时代的评传。所以,很可能的,许多人看了这部评传会感到惊讶骇异,从正文来...
无戒:原名郝菲,青年作家,资深写作课讲师,无戒传媒创始人。已出版《零基础新媒体写作指南》,小说《38℃爱情》