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页
杉井光:第12回電撃小説大賞《銀賞》受賞者。代表作に『神様のメモ帳』『さよならピアノソナタ』など
道医 本书特色 介绍了道医的起源及其与传统中医的关系,道医的发展简史,道医对人体及医药的认识,道医诊法与医技以及作者的学习心得和临证医案,包括一些极为珍贵的家传...
克里斯托弗·鲍里尼是一个从未进过正规学校、全部教育业自母亲的少年。长期以来对奇幻小说的迷恋,促使他在十五岁时写出自己的处女作《伊拉龙》,现在他十九岁,和家人一起...
殊能将之(Syunō Masayuki)1964年出生于日本福井县,名古屋大学理学部肄业。不为读者熟悉的神秘作家,笔名来源于《楚辞》中《天问》一篇的“何冯弓挟矢...
髓鞘科学-解密21世纪神经科学及脑重大疾病的新视角-新观点新学说学术沙龙文集-39 本书特色 髓鞘是包裹在神经纤维上的重要结构,参与了包括神经细胞分化、发育、信...
拨开迷雾学中医 本书特色 中医治病几千年来一直沿用一个规律,这个规律就是天地间四时五运流转的规律,在人体就是六经阴阳传变规律,这个规律古人称之为“道”。本书作者...
“天下至真文字,人间至亲情感”。这本由王小波的胞兄王小平博士撰写的回忆录,以“零距离的胞兄视野,向我们披露了一个中国知识分子的少年史,他如何从艰难的时世走来,登...
井上 雄彦(いのうえ たけひこ、本名:成合 雄彦(なりあい たけひこ)、1967年1月12日 - )は、日本の漫画家。鹿児島県大口市(現・伊佐市)出身、熊本大学...
Susan and Victor have written the "Junior Woodchucks Guidebook" of Web applicati...
A dictionary for a world whose cities are linked by fiber optic cables and whose...
唐宋诗鉴赏辞典--中华诗文鉴赏典丛(平装) 本书特色 中华诗文鉴赏辞典类图书是一套重在普及、雅俗共赏的图书。中国是一个诗词的国度,古典诗词源远流长,荟萃了中华民...
医院财务制度基层医疗卫生机构财务制度讲解 内容简介 《医院财务制度:基层医疗卫生机构财务制度讲解》既可以作为新制度的培训教材,也可以作为有关单位贯彻执行新制度的...
Hereisastorywithaboyhero,andaboyofwhomyouhaveneverbeforeheard.Therearegirlsinthe...
Theimportanceofemotionalintelligenceasacriticalfactorinpersonalandbusinesssucces...
风能技术 本书特色 热点性:就当今热点话题风力发电展开叙述先进性:反映风力发电领域的全新研究成果系统性:详细具体地介绍风力发电相关技术实用性:指导读者进行风电应...
曾国藩是在多少岁的时候改号“涤生”的?在多大的时候结婚、生子?他中进士是哪一年?得的是什么名次?他在30岁时做了些什么事?
唐代律令制研究 内容简介 长期以来,学术界对唐代法律史的探究仅侧重于唐律一种法律形式,而没有把律、令、格、式四种法律形式当作一个相互联系的整体加以综合考察。本书...
杨绛(1911—),钱锺书夫人,作家、学者、翻译家。主要作品有小说《洗澡》《洗澡之后》,散文《干校六记》《我们仨》《走到人生边上》,剧本《称心如意》《弄真成假》...
桥川时雄(1894—1982),是中日近代文化交流史上一位重要人物,他出生于汉学家家庭,1918年来到中国成为日本共同社的翻译记者,后成为北京大学国文科的旁听生...
Covering the basic techniques used in the latest research work, the author conso...