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页
亦舒,原名倪亦舒,兄長是香港作家倪匡。 当亦舒一露头角就迅速成名时,两兄妹就成了香港文坛上的两杂奇花。有人称之为奇迹,说亦舒、倪匡、金庸是“香港文坛三大奇迹”。...
梁啟超,字卓如,号任公,别号饮冰室主人,中国近代著名的政治家、思想家和学者。他学训渊博,著述丰富。《饮冰室合集》是目前比较详备的梁啟超著作集,也是研究近代中国政...
新生代疗愈系作家七朗萌宠治愈之作◆深情演绎人与宠物的双向救赎孤独灵魂的彼此治愈◆爱让我们和汪星人连接在一起宝贝,让我带你回家-《隐秘的角落》导演辛爽倾情作序演员...
老子,道祖。吕洞宾,名岩,道号纯阳子,永乐县招贤里(今山西省芮城县永乐镇)人,生于唐德宗贞元十二载(796年),为全真道北五祖之一,钟(钟离权)吕内丹派、三教合...
[美]杰德·麦肯纳(Jed McKenna),一个并不符合所谓“心理老师”形象的老师,喜欢打电动、骑越野车、跳伞、读惠特曼的诗。 他在美国的爱荷华州有许多学生,...
主任记者、中国摄影家协会会员、中国民俗摄影协会会员近年来,热衷于自助游事业的发展,不但自己开辟多条自助游线路,每年还数十次带队带领驴友、摄影师全国各地进行自助游...
Ecohydrologyemergesasanewfieldofresearchaimingatfurtheringourunderstandingofthee...
作者约翰·史崔勒基John Strelecky他和书里那个“约翰”一样,曾经非常迷茫。本来拥有 MBA 学位,在企业工作多年。32岁那年,他决定和妻子背起背包,...
马丁•纽曼(Martin Newman),国际顶级演讲导师,常年为全球政治、商业领袖提供公众演讲的策略建议和培训指导。曾任英国前首相卡梅伦、俄罗斯总统普京的演讲...
棒敲击疗法 本书特色 朱增祥医师是香港执业医师,祖传中医,妙手仁心,在港岛享有很高的声誉。《棒敲击疗法》介绍的棒敲击疗法,适用于全身或者肩部肌肉僵硬、筋缩引起的...
中西医结合临床精萃 内容简介 本书收集并精选近十多年来国内公开发表的医药期刊中有关中西医结合*新、疗效*好的报道,采取分科论病,以病为纲,以病统方的方法进行汇编...
民商法实务精要-3 本书特色 民商法实务精要第3辑精选27篇精华文章,涉及基础实务技能、债与合同、物权与担保、公司法、金融法、程序法及其他领域,包括基础技能、实...
袁岳零点研究咨询集团董事长、飞马旅创始人、零点青年公益创业发展中心理事长、独立媒体人、学者。1992年创办零点研究咨询集团,从民意调研走向互联网化的交互数据服务...
杨翱,男,写作者,自2010年起担任著名作家蔡澜先生的助理,负责处理出版业务及开发网店,协助出版了蔡澜先生的《人间好玩》《过好这一生》《命运好好玩》等作品,杨翱...
官、民与法(明清国家与基层社会) 目录 前言:学术史与研究思路法律史的学术史社会史与法律史历史人类学的试验田阶段性成果与本书的内容法律与社会变迁——以户绝财产继...
日語形容詞中的「痛」不但會「痛」在身上,還會「痛」在東西上;Bijinniwayowai(對美女毫無招架之力)!想不到yowai的轉義有「毫
戴维·M. 格兰茨(DAVID M. GLANTZ),被誉为西方研究红军在伟大卫国战争中表现的首席专家、最高权威,1942年1月11日生于美国纽约州,美国陆军退...
影照,女,地球人,八零后春天出生。生平无甚大志,偶以写文为乐,喜欢怀旧、幽默和古典,凭借白羊座特有的自信以及莫名好运,安稳度过人生的四分之一。向往简单,生活态度...
随着移动互联网和智能手机红利接近天花板,中国科技产业的这一波“直道高速竞争”接近尾声。无论大公司还是创业者,都在探索新科技和新机会。中国乃至全球科技产业将进入一...
龙泉司法档案不仅完整记录了近代法律制度的基层实践,也记录了法律与社会经济生活、民众观念之间的互动机制和变迁过程,包括人们怎样用法律的语言来陈述自己的生活和遭遇,...