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页
作者简介莎士比亚(1564—1616),英国诗人、戏剧家和散文家,1564年出生于英国沃里克郡斯特拉福镇,1585年前后,离开家乡去伦敦,先在剧院打杂,后来当上...
立体构成是现代艺术设计中非常重要的设计基础学科,本书从形态与立体空间、形式规律与法则等基本原理出发,详细解析了立体构成在
一百天学中药 内容简介 《一百天学开中药方》是以“方证相应”为依据,指导读者开中药方。本书则以“药证相应”为原则,着重介绍中药的解表、清热、泻下、祛湿、利水、温...
很多公司把廣告看作是開銷而非投資,所以在這場金融風暴消費緊縮的狀況下,廣告預算常被列在最可能刪減的費用的頭幾項。之所以會造成這樣尷尬的處境有兩大主要因素,其一,...
“看画本身经常是不够的。我们要找到能够分析和描述画的语言,这样才能从被动的观者变成主动的观者,变成有所领悟的观者。”——苏珊·伍德福德为什么要画这幅画?它反映了...
脉学正义 本书特色 《张山雷医学丛书:脉学正义》是张山雷先生的倾力之作,是他诊断学、特别是脉学方面成就的集中体现。《张山雷医学丛书:脉学正义》共分六卷,约四十万...
陈幼林,1978年出生于江西宜春,深圳大学工商企业管理专业毕业。国际互联网电子商务协会执行会长、深圳华商资讯董事长。国家注册高级企业培训师、中国人力资源部首批备...
作品目录前言凡例部首第一篇上一部上部示部三部王部玉部玨部气部士部丨部第一篇· · · · · ·
作品目录译本序第一章第二章第三章第四章第五章第六章第七章第八章第九章第十章第十一章第十二章第十三章第十四章第十五章第十六
程东升,男,就职于南方报业传媒集团、著名财经媒体——《21世纪经济报道》,南方都市报深圳智库特聘专家,深商研究会成员。具有近10年的媒体工作经历。持续追踪、研究...
作品目录序言:高明出版人的三种本事陈四益第1法:畅销书折射历史第2法:百岁畅销书榜单第3法:“嫁人要嫁易中天”第4法:30本畅
《Borland传奇》第一版问世的时候,因时间仓促,难免存在出版上的瑕疵,现在再版得以弥补,加上李维先生又增补了不少内容,特别是对下一阶段IT技术的发展给出了前...
非天夜翔:畅销小说家,晋江所有作品点击均过亿,常年横扫更大榜单。文风大气细腻,故事跌宕起伏,从幻想冒险到古代权谋全都得心应手,堪称跨类型全能写手。非天夜翔粉丝众...
作品目录导言上卷《伊萨奥义书》释《白骡氏奥义书》释下卷《秃顶奥义书》释《卡塔奥义书》释译后记· · · · · ·精彩摘录在
作品目录一. 宋太宗與佛教 1. 時代背景 2. 世尊形象 3. 佛像,僧侶的管制 4. 建寺與修寺 5. 譯經與傳法 6. 佛法之妙用 7. 影響與
关于《没有不好玩的时候》《没有不好玩的时候》精选中国儿童文学泰斗任溶溶的幽默智慧童诗68首,编为三辑。第一辑更多以孩子的视角看世间万象,作品洋溢着天马行空的想象...
作品目录1.目录序 请钱钟书打手心钱钟书手不释卷信札二通琐忆钱钟书先生情牵携手到白头石遗室论钱钟书诗钱钟书诗序诗坛前辈咏钱
光晕组合出于对带有强烈冲击力色彩的共同爱好而组成的创作组合。由设计师饭渊典子、插画家伊藤智代美、编辑兼文字武智美惠组成。
作品目录目 录无用的哲思 003有为与无为 011追求完善的遗憾 017平庸者伟岸 023人性之根:贪、烦、畏 027“快乐公式”题解
作品目录第一章 太古集团的早期活动第二章 太古集团的扩展第三章 太古轮船公司在华航运优势的确立第四章 太古集团巩固在华利益的