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页
陀思妥耶夫斯基(1821-1881),与大文豪列夫·托尔斯泰、屠格涅夫等人齐名,是俄国文学的卓越代表,他走的是一条极为艰辛、复杂的生活与创作道路,是俄国文学史上...
约翰·伯格(John Berger),英国艺术评论家、小说家、画家和诗人。1926 年出生于英国伦敦。1944年至1946年在英国军队服役。退役后入切尔西艺术学...
园林绿化种植与养护工程问答实录 本书特色 本书为北京市园林局绿化处50多年技术成果的积累与总结,以问答的形式对园林苗木培育和绿化施工技术的具体做法进行了系统的介...
★安纳西国际动画电影节获奖短片原著作品★安古兰漫画节官方提名作品★法国亚马逊满分佳作★★★★在法国西南部海滨的纪龙德河口,生存着一种其貌不扬的 小方蟹,小方蟹从...
稳飞:中国人民大学金融学硕士。金牛座。热爱摄影,游泳,羽毛球,极限运动等。大学生创业者,教育学思考者。熟练英语,精通日语、韩语等多国语言。人生格言:快乐每一天,...
Paintingisboundtoshineagainsoonthelightofwisdom.Somecriticsdeclareditsdeathinthe...
赵琛法学论著选 本书特色 本书选录了赵琛的著名判决七篇,收录了赵琛的主要论文十余篇,选录了赵琛的重要著作《监狱学》、《保险法要纲》、《少年犯罪之刑事政策》三部。...
江苏油田年鉴:2004 内容简介 本年鉴系统、翔实地记述了江苏油田2003年苏皖油气勘探开发和两个文明建设中的基本情况、*新成果和有关资料。江苏油田年鉴:200...
谢和耐(Jacques Gernet, 法国, 1921- )是法国20世纪下半叶著名的汉学家、历史学家、社会学家、法国金石和美文学科学院院士,法兰西学院名誉教...
中华人民共和国立法法讲话(修订版) 本书特色 法律的权限范围;法律的制定程序;法律解释;行政法规;地方性法规;自治条例和单行条例;规章;适用规则与备案审查。中华...
《夷坚志》书名出自《列子.汤问》:《山海经》为"大禹行而见之,伯益知而名之,夷坚闻而志之。"大意是指《山海经》中的故事是大禹看到的,伯益取的名,夷坚听说后记载下...
1944年12月,就在二战行将结束之际,希特勒又一次令世界震惊:德军从比利时和卢森堡东部林木茂盛的阿登山区发起了一次强有力的反击,并在盟军战线上形成了50英里的...
《培训师》的主人公从海龟开始,进入跨国公司,最后从事企业内训,直至成为独立培训师的曲折历程,覆盖了众多现代企业雇员的共性
故事發生在宋朝,一對江南世家夫婦前往遼國尋找藥引玉樹臨風的丈夫與美麗的妻子,帶著一個尚在襁褓的女嬰匆匆趕路路經黑山天池時,卻碰上來意不善的契丹人先是調虎離山引走...
作者:迈兮,90后行者,曾留学美国、西班牙、日本,旅居海外八年,周游四十余国。迈兮热衷于文化交流和冒险,坚持做行者而非过客,边走边收集故事。插画师:城辉,90后...
宋春涛:从事管理培训、人力资本咨询超过10年,先后服务过安利、雅芳、IBM、中国民生银行等众多国际和本土知名企业, 曾为100多家企业、3000多名学员进行过演...
李旭东文史学者、作家、编剧,中国科普作家协会会员、中国小说学会会员。研究和写作唐史十余年,立志于传播唐代历史文化。主要作品有《大唐仕宦生活录》《盛唐的拐点》《刀...
绿色高性能混凝土技术与工程应用 本书特色 本书介绍了从高性能混凝土的提出到绿色高性能混凝土的技术发展过程;论述了绿色高性能混凝土技术的理论要点;从水泥、骨料、矿...
作者简介彼得.谢弗(Peter Shaffer 1926- )英国戏剧家。《群马》一剧使他为美国观众所熟悉。他创作的《五指练习》、《私人的耳朵和公众的眼睛》、《...
尾魚:熱衷一切奇思怪想的軼聞,相信世界的玄妙大過眼睛,熱愛旅行,尤喜探險,卻每每受縛於膽小畏怯,於是專在故事裡天馬行空洋洋得意。