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页
漫话通信信号 本书特色 《漫话通信信号》:你听说过铁路的“千里眼”和“顺风耳”吗?“红灯停、绿灯行”的规矩是怎么来的?列车运行和卫星有什么关系吗?找出火车运行听...
南塘村的意义超过乌坎,越过小岗村,它昭示着中国真正民主时代的来临。自五四运动提出“民主”与“科学”的口号至今,九十多年过去了,“民主”作为口号深入人心,但实际操...
【内容介绍】以儿童为出发点的设计主题,广泛丰富的体裁,举凡自然界的生物、水果、美食、人类生活上的日常用品、衣食住行,及各国文字字母,都可成为刺绣主题的内容,充份...
《大数据党政领导干部一本通》内容简介:《“十三五”行政机关公务员培训纲要》提出加强大数据思面的培训。本书首先论述了大数据的
MultimodalDiscourseAnalysisisacomprehensivesurveyofthewaysinwhichenhancedmeaning...
袁越:1990年毕业于复旦大学生物工程系。1992年留学美国,获生物学硕士学位。1994—2004年,在美国从事生物技术研究。2005年回国担任华纳唱片公司欧西...
作者简介贝格尔是当代著名的美国社会学家和宗教学家,波士顿大学、鲁特基斯大学和社会科学研究院研究生院的教授,美国宗教学研究
1957年反右斗争期间,作者和作者的丈夫王景超双双被划为右派分子,王景超并被定为极右分子,开除公职,劳动教养。他们一下坠入黑暗的深渊,成为阶级敌人,都被发配到农...
ArthurKaysexcitingnewpublicationisamusthaveforpracticing,professionalelectricale...
李翔(作者)资深媒体人,得到App总编辑,《李翔商业内参》《李翔知识内参》《巨富之路》等系列课程主理人。曾任《经济观察报》主笔、《彭博商业周刊》中文版副主编、《...
马克•科利尔,埃及学博士,现为英国利物浦大学埃及学教授,教授《中古埃及语》《晚斯埃及语及科普特语》《晚期埃及语文献》《僧书体文字》等课程。自2007年以来担任《...
“你骗得过味蕾,却骗不了你的胃。”烹饪,从广义上来讲,就是人们发明并使用一系列方法来将生鲜食材加工成可口营养的美食的过程,是人类做的最有趣也最有价值的事情之一。...
作品目录前言安东·凡·代克埃德加·德加奥古斯特·罗丹古斯塔夫·克里姆特埃贡·席勒瓦伦丁·谢洛夫亨利·马蒂斯巴勃罗·鲁伊斯
作品目录黄金时代2黄金时代3黄金时代4黄金时代5黄金时代6· · · · · ·
普济方集 内容简介 本书是祖国医学的重要典籍之一, 原文由阿旺·洛桑·丹毕坚赞·巴勒桑布贤者藏文编撰。内容包括赫依病、协日病、巴达干病、宝日病、食不化病、痞块症...
作者简介:成田良悟:日本轻小说作家,毕业于日本大学文理学部地球系统科学专业。2002年以出道作《永生之酒》夺得第九届电击小说大赛金奖。现已出版四个系列的轻小说作...
人们对纽约的印象被各种传奇色彩填满,实际上这座城市的面积小得惊人。曼哈顿岛长21.5 千米、宽3.7 千米,最近的一次土地丈量结果显示纽约5 大行政区总面积仅为...
中国种种传统政治迷信,最终都可以归结为对政治权力的崇拜。要推进政治进步,必须清理千百年来政治迷信的根基,努力洗刷其残迹,摆脱“宰猪场式的政治”,“使人成其为人”...
小说家朱天心的小小“人类学报告”陪伴你、观察你、记录天真烂漫的你,令我成长为母亲一位稚气未褪而用情至深的新手妈妈邂逅一匹初入世间冲撞试探的“小兽”踏上一场来不及...
Alvin Alexander走上软件开发之路比较曲折。虽然他从得克萨斯州的A&M大学拿到了航空工程学学位,但他真正想做的却是打棒球。成为见习工程师时,他意识到...