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页
冯仑,男,1959年出生于陕西省西安市。曾获中国西北大学经济学学士、中央党校法学硕士、中国社会科学院法学博士学位。1984年至1990年,先后在中央党校、中共中...
精彩摘录《楞伽经》,又称《大乘入楞伽经》,是一部大乘经典。“楞伽”二字,系梵音,意译为“难入”。所谓“难入”者,原指摩罗
【关于夏茗悠】夏茗悠,女,生于1988年11月。现就读于北京大学广播电视编导专业。1994年在《小星星》杂志发表处女作,之后在《萌芽》、《课堂内外》、《布老虎青...
作品目录一个王朝的背景流放者的土地苏东坡突围遥远的绝响抱槐山西历史的暗角脆弱的都城千年庭院乡关何处天涯故事十万进士青云谱
Foryears,thetwokingdomsofDelmaaandPrantarrcoexistpeacefully.Butwhenmonthsofunpre...
作品目录part 1时尚手提包 20款圆底购物大包皇冠图案的手提包弧形购物包休闲购物包拼布复古包单肩复古包宽松复古包毛茸茸的复古
一个绰号“五点”的高一男生,每天在日记簿上画卡通、写故事,记录自己与身边同学的经历感受。从生吃蚱蜢的军训,到歌唱孤独男孩心声的艺术节;从篮球队,到两只宝贝龟;从...
作品目录1 历史借镜2 大战前奏3 特兰城下4 形势逆转5 特兰大捷6 魔族内乱7 和谈8 祸起不测9 灾难10 重逢致读者· · · · · ·
编辑推荐在中国建筑界,曾经有一位传奇人物,他是中国*代现代建筑大师,他与梁思成、陈植、林徽因等人同学,他曾师承美国水彩大师道森,他的建筑设计遍布上海、南京等地,...
{编辑推荐}● 为什么戴着面具的人更受欢迎?● 职场达人首度揭开心理学大师荣格“人格面具”的奥秘● 一本极具实操指导性的交际提升读本● 成功人士都在用的职场交际...
吕吉·巴津尼(1874—1947),意大利著名记者和作家。1900年曾被意大利专业报纸《晚间邮报》作为战地记者派到中国报道义和团运动,1904—1905年又作为...
关于日杂手感空间,你最在乎的关键细节是什么? 看着《come home!》杂志里一幕幕与家人和乐悠闲的生活场景,好有生活感!好温暖!令人心生向往这般自然舒适的空...
由《动物之心》等十余篇中短篇小说构成,题材以当代青年的日常生活为主。李唐是90后作者中发表文章层次最高的写作者之一,在对小说理念的体会及技巧的把握上,李唐早已将...
【美】 拉腊·菲尔丁(Lara E. Fielding)哈佛大学心理学博士,心理学家,专门研究认知行为疗法、辩证行为疗法、接受和承诺疗法、正念减压、正念认知疗法...
赵伟:团队管理专家,长居北京,现为某文化传媒公司总裁。他从事管理工作多年,在管理过程中不断学习与研究现代企业的管理模式,对将欧美先进的管理模式落地中国有着丰富的...
余秋雨浙江余姚人,当代著名散文家,文化学者,艺术理论家,文化史学家。著有《文化苦旅》《何谓文化》《中国文脉》《山河之书》《霜冷长河》等。 余秋雨的书籍长期位居全...
风云无边-于桑纪念文集 本书特色 这部《风云无边——于桑纪念文集》由于晋主编,由纪念公安部原副部长于桑同志的百余篇文章、访谈录,以及于桑副部长和家人的照片组成。...
知识与法律“小南湖读书小组”文选(第二辑) 本书特色 本文集所辑录的是一些论者根据特定安排、针对若干特定文本、在认真阅读的基础上形成的学术性法律书评。除了这些学...
高建国,1951年生于上海。下过乡,当过工作、干部、电视摄像师、编导制片人、文字记者、编辑等,后致力于文化企工作。70年代起,从事人物传记与纪实作品创作,主要作...
斯坦福大学教授,主攻考古学和神话学,是伦敦皇家地理学会研究员参与多部知名纪录片录制,纪录片制作方包括“国家地理探索者”(National Geographic ...