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页
吴旻,女,江苏南京人。先后就读于南京大学哲学系、法国普瓦提埃大学、里昂第二大学、法国巴黎高等社会科学研究院,曾在欧美从事研究多年。现任职于法国远东学院北京中心。...
德语区刑法学的自画像(上下卷) 内容简介 本书是一本学术自传体性质的刑法专业书籍,汇集了二战后德语区刑法学二十一位知名刑法教授的自我陈述。通过本书,读者不仅可以...
《山海经》主要记述的是古代神话、地理、物产、巫术、宗教、古史、医药、民俗、民族等方面的内容。古代中国神话的基本来源就是《山海经》,其中最著名的包括:夸父追日、女...
阿克塞尔•霍耐特(Axel Honneth,1949—)德国著名社会理论家,法兰克福学派第三代旗帜性人物,曾任柏林自由大学社会学研究所研究员、法兰克福大学哲学教...
椿泉,日本人气漫画家。作品多以搞笑轻喜剧为主,不落俗套。2002年在《花与梦》上登载《拇指罗曼史》出道。此作获得第28届白泉社雅典娜新人大赏的新作优秀者奖。代表...
木子,真名李世强,内蒙古乌兰察布市人,公关活动策划人。曾从事图书编辑、互联网企业主编、互联网培训师等工作。专注于心理、情绪、人格与人际交往、职场等领域研究数十年...
精彩摘录这根本不是秘密。这个圈子就这么大,彼此心照不宣,各自快活,何必分心他人闲事?他正竭力表现出那小心翼翼的爱恋,但藏
现代通信技术基础第2版 本书特色《现代通信技术基础》第2版体现了近年来通信专业教学改革与精品课程建设的成果,将通信行业国家职业标准的相关要求融人课程标准,在教学...
作品目录第一章 一个更好的机会 第二章 纸牌房 第三章 掷骰子游戏 第四章 墨西哥银行的狂欢节 第五章 大灾难 第六章 RAVS女王 第
公安民警执法办案常用手册-第八版 本书特色 随着依法治国的深入,公安法制的发展,基层民警在日常执法办案时,需要用到越来越多的法律法规,依据各种各样的制度规范。这...
小仲马著的《茶花女》讲述的是一个离奇曲折、缠绵悱恻而又荡气回肠的爱情故事。一次邂逅,令阿尔芒对美丽的妓女玛格丽特一见钟情
朱爱岚(Ellen R.Judd),加拿大社会文化人类学家。在加拿大的不列颠歌伦比亚大学获得博士学位并在剑桥大学做博士后研究之前,于1974-1977年间曾在北...
君约南方人,死宅一枚,内心里刀光剑影,偏爱简单温暖的治愈系故事。代表作《你去爱世界,我来爱你》(网络原名《繁简》)《将醒》。微博:@君约哇
[英]理查德·道金斯(Richard Dawkins,1941— ),英国皇家科学院院士,牛津大学首席西蒙尼“公众理解科学教授”,进化论生物学家。他是英国著名科...
程莹,北京大学外国语学院亚非系助理教授。研究方向为非洲文化,非洲文学,非洲的视觉与表演艺术,青年与城市空间。南非罗德斯大学非洲与南南艺术项目研究员,Journa...
《朱雀卷》一步天下,一步江湖,昔日惊才绝艳的“四顾门”门主李相夷,如今慵懒落魄的吉祥纹莲花楼楼主李莲花,云泥之别的背后隐藏着怎样的故事?碧窗上舞动的鬼影,害人性...
民事优先权研究 本书特色 民事优先权制度是对特殊的民事权利或权利人予以特别保护的制度,本书主要研究民事优先权中的优先受偿权。本书共分十章,*章为民事优先权概念,...
《期货多空逻辑》内容简介:市场上关于期货技术分析的图书多如牛毛,而关于期货基本面分析的图书并不多见,即使有相关的基本面图书
杰弗里·劳埃德(G.E.R.Lloyd,1933—),英国剑桥大学教授、李约瑟研究所常驻资深学者,主要研究古代哲学、科学与医学的历史,注重跨文化、跨学科比较,尤...
《牛医生女性健康指南》内容简介:随着社会的进步,人们的健康意识逐步增强,对于身体保养的相关知识也在增加。但即便如此,还是有