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页
钢-混凝土组合梁结构:试验、理论与应用 内容简介 本书总结了有关钢一混凝土组合梁的系列研究成果,包括组合梁的力学性能、设计理论和设计方法等,并对部分工程实例进行...
牧铃,40年前真的干过牧童,领着一群奶牛和两头牧犬,在南方的山区牧场兴高采烈地度过了少年时代。后来,当衣民当工人当教师……眨眼之间自己成了"爷爷",回头望望,最...
《腐败与政府》第1版于1999年出版,已被翻译成17 种语言,这本书引发了学界和政界对腐败问题的广泛思考。在1999年首版《腐败与政府》的基础之上,作者在第2版...
作品目录花之寺僧飘浮在空中的兰若石和尚林春红我的外公是雷神夜 叉蛙之歌终 南吴单贾义列传春之牙归 墟四时歌无端儿双 髻一
《中国崛起不可承受之错》,中国问题专家、高层智囊大声疾呼,警惕颠覆性错误,秉笔直书,向顽瘴痼疾开刀。习主席近年来多次强调, “中国是一个大国,决不能在根本性问题...
如果你遭受过虐待、欺骗、背叛、冷暴力或家庭暴力,你的生活将会是痛苦不堪的。你是如此地受着折磨。你无法正常开车,工作效率降低,甚至于和自己的孩子也无法正常相处……...
《人为何物:进化的逻辑》内容简介:二战后高歌猛进的全球化,让许多预言家误以为人类已经步入一个“地球村”的大同世界。正当人们
中国新建筑文化之理论建构-中国建筑文化研究文库 本书特色 ★ 16开精装,湖北教育出版社出版★ 本书为中国建筑文化研究文库”第31号专著★ 本书作为一部重头的专...
◎ 编辑推荐罗永浩:“在彻底改写人类命运的巨变来临之际,推荐每一个不想被时代抛弃的朋友都看看这本书。”✓ “搜狗输入法之父”、美团光年首席AGI布道师马占凯首部...
《生命宇宙以及一切》是英国作家道格拉斯·亚当斯所著的“科幻圣经”《银河系漫游指南》系列的第三部,写于80年代初。故事承接了第二部阿瑟与福特回到数百万年的地球的线...
《可以装单纯,但别太单纯》主要内容简介:人生最大的悲哀,就是纯真的想法,往往被丑陋的事实所扼杀。物质生活充裕的80、90后一代
卫哲,一个现代年轻经理人的典范。他当上首席执行官的时候还只有31岁,是世界500强中最年轻的中国总部CEO。是什么原因促使他如此平步青云?他在职场成功发展的进程...
作品目录上册著者访谈Ⅰ 现代推理小说论现代推理小说的前途现代犯罪和本格推理小说——关于《希腊棺材之谜》的论争Ⅱ 作家论水
Inthisbook,thenewmetalcomplexesofsulfamethoxazole(antibiotic)withpalladium(II),i...
广告是一道亮丽的城市风景,也是一种商业美。古人还在不经意中把不同时代的审美与风韵溶入到形形色色的广告中。——中国文联副主席、中国民间文艺家协会主席冯骥才民间传统...
英文版序言中文版序言第一部分出发点第一章内容与方法1.1历史发展的特殊路径与一般特征1.2社会主义国家1.3对“社会主义”一词的解释1.4“政治经济学”1.5实...
“我在未来等你”“嗯,马上就去,跑着去。”用什么来形容时间?漫长,短暂,须臾,不朽。抽象和神秘。听说,由于光的传播需要一定的时间,虽然微小得就连最精密的仪器都难...
本书是唯慈的三卷本《现代中国佛教丛书》中的第二部。第一部着重探讨了现代中国佛教的体系制度、教会组织体制和制度;第三部将从制度和历史两个方面论述在共产党统治下中国...
戴锦华,北京人。毕业于北京大学中文系,曾于北京电影学院电影文学系任教11 年,1993 年起任教于北京大学比较文学与比较文化研究所。北京大学人文特聘教授,北京大...
杨艾祥,中国注册高级人力资源管理师,记者出身的企业管理与职业发展领域的研究者。曾在《21世纪人才报》、《TEAM magazine》等媒体供职,现为秀客网(ww...