JavaScript Patterns 中文版

JavaScript Patterns 中文版

偷懒是程序员的优良品质,模式则是先人们总结的偷懒招式。Stoyan Stefanov 的这本书,从 JavaScript 的实际使用场景出发,提炼了不少可以让前端们偷懒的实用招式。模式的探索、创新,将永远是程序员自我提升的一条修炼之道。值得一读。

具体内容,查看以下链接


转自:http://lava.cn/article.php?id=165052&chid=705

Description What's the best approach for developing an application with JavaScript? This book helps you answer that question with numerous JavaScript coding patterns and best practices. If you're an experienced developer looking to solve problems related to objects, functions, inheritance, and other language-specific categories, the abstractions and code templates in this guide are ideal -- whether you're writing a client-side, server-side, or desktop application with JavaScript. Author Stoyan Stefanov includes several examples for each pattern as well as practical advice for implementing them. What's the best approach for developing an application with JavaScript? This book helps you answer that question with numerous JavaScript coding patterns and best practices. If you're an experienced developer looking to solve problems related to objects, functions, inheritance, and other language-specific categories, the abstractions and code templates in this guide are ideal -- whether you're writing a client-side, server-side, or desktop application with JavaScript. Written by JavaScript expert Stoyan Stefanov -- Senior Yahoo! Technical and architect of YSlow 2.0, the web page performance optimization tool -- JavaScript Patterns includes practical advice for implementing each pattern discussed, along with several hands-on examples. You'll also learn about anti-patterns: common programming approaches that cause more problems than they solve. * Explore useful habits for writing high-quality JavaScript code, such as avoiding globals, using single var declarations, and more * Learn why literal notation patterns are simpler alternatives to constructor functions * Discover different ways to define a function in JavaScript * Create objects that go beyond the basic patterns of using object literals and constructor functions * Learn the options available for code reuse and inheritance in JavaScript * Study sample JavaScript approaches to common design patterns such as Singleton, Factory, Decorator, and more * Examine patterns that apply specifically to the client-side browser environment
第1章 简介   模式   JavaScript:基本概念   ECMAScript 5   JSLint   Console   第2章 基本技巧   编写可维护的代码   尽量少用全局变量   for循环   for-in循环   不要增加内置的原型   SWitch模式   避免使用隐式类型转换   使用parseInt()的数值约定   编码约定   命名约定   编写注释   编写API文档   编写可读性强的代码   同行互查   在正式发布时精简代码   运行JSLint   小结   第3章 字面量和构造函数   对象字面量   自定义构造函数   强制使用new的模式   数组字面量   JSON   正则表达式字面量   基本值类型包装器   错误对象   小结   第4章 函数   背景   回调模式   返回函数   自定义函数   即时函数   即时对象初始化   初始化时分支   函数属性——备忘模式   配置对象   Curry   小结   第5章 对象创建模式   命名空间模式   声明依赖关系   私有属性和方法   模块模式   沙箱模式   静态成员   对象常量   链模式   method()方法   小结   第6章 代码复用模式   传统与现代继承模式的比较   使用类式继承时的预期结果   类式继承模式#1——默认模式   类式继承模式#2——借用构造函数   类式继承模式#3——借用和设置原型   类式继承模式#4——共享原型   类式继承模式#5——临时构造函数   Klass   原型继承   通过复制属性实现继承   借用方法   小结   第7章 设计模式   单体模式   工厂模式   迭代器模式   装饰者模式   策略模式   外观模式   代理模式   中介者模式   观察者模式   小结   第8章 DOM和浏览器模式   关注分离   DOM脚本   事件   长期运行脚本   远程脚本   配置JavaScript   载入策略
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值