Submit Search
Upload
Writing better code
•
Download as PPTX, PDF
•
0 likes
•
477 views
chuan yuan
Follow
writing better code
Read less
Read more
Technology
Design
Report
Share
Report
Share
1 of 22
Download now
Recommended
Cloudintroog2 141126041208-conversion-gate02
Cloudintroog2 141126041208-conversion-gate02
life2013
What You Should Be Informed About programa de facturacion saint And Reason Why
What You Should Be Informed About programa de facturacion saint And Reason Why
hammersand9
Art Alert oktober 2015
Art Alert oktober 2015
Art Alert
Important Achievements
Important Achievements
Rubalpreet44
Cuaderno de recursos para maestros de ciencias sociales bueno
Cuaderno de recursos para maestros de ciencias sociales bueno
Cristina Subies Rios
Chapter 10-TOR
Chapter 10-TOR
Jonathan Reeves
The right approach to the economy
The right approach to the economy
alfredobinnie
Kecamatan nunukan-dalam-angka-2015
Kecamatan nunukan-dalam-angka-2015
Arifuddin Ali
Recommended
Cloudintroog2 141126041208-conversion-gate02
Cloudintroog2 141126041208-conversion-gate02
life2013
What You Should Be Informed About programa de facturacion saint And Reason Why
What You Should Be Informed About programa de facturacion saint And Reason Why
hammersand9
Art Alert oktober 2015
Art Alert oktober 2015
Art Alert
Important Achievements
Important Achievements
Rubalpreet44
Cuaderno de recursos para maestros de ciencias sociales bueno
Cuaderno de recursos para maestros de ciencias sociales bueno
Cristina Subies Rios
Chapter 10-TOR
Chapter 10-TOR
Jonathan Reeves
The right approach to the economy
The right approach to the economy
alfredobinnie
Kecamatan nunukan-dalam-angka-2015
Kecamatan nunukan-dalam-angka-2015
Arifuddin Ali
重构——关于可读性、原则和模式
重构——关于可读性、原则和模式
cnfi
淘宝网前端开发面试题
淘宝网前端开发面试题
Lumend
Ruby Object Design (Chinese)
Ruby Object Design (Chinese)
Eddie Lee
日新培训
日新培训
pan quanjin
PHP Coding Standard and 50+ Programming Skills
PHP Coding Standard and 50+ Programming Skills
Ho Kim
Refactoring
Refactoring
liufabin 66688
[書摘] Web表單設計:點石成金的藝術 (美)Web Form Design Filling in the Blanks
[書摘] Web表單設計:點石成金的藝術 (美)Web Form Design Filling in the Blanks
Miya Chang
More Related Content
Similar to Writing better code
重构——关于可读性、原则和模式
重构——关于可读性、原则和模式
cnfi
淘宝网前端开发面试题
淘宝网前端开发面试题
Lumend
Ruby Object Design (Chinese)
Ruby Object Design (Chinese)
Eddie Lee
日新培训
日新培训
pan quanjin
PHP Coding Standard and 50+ Programming Skills
PHP Coding Standard and 50+ Programming Skills
Ho Kim
Refactoring
Refactoring
liufabin 66688
[書摘] Web表單設計:點石成金的藝術 (美)Web Form Design Filling in the Blanks
[書摘] Web表單設計:點石成金的藝術 (美)Web Form Design Filling in the Blanks
Miya Chang
Similar to Writing better code
(7)
重构——关于可读性、原则和模式
重构——关于可读性、原则和模式
淘宝网前端开发面试题
淘宝网前端开发面试题
Ruby Object Design (Chinese)
Ruby Object Design (Chinese)
日新培训
日新培训
PHP Coding Standard and 50+ Programming Skills
PHP Coding Standard and 50+ Programming Skills
Refactoring
Refactoring
[書摘] Web表單設計:點石成金的藝術 (美)Web Form Design Filling in the Blanks
[書摘] Web表單設計:點石成金的藝術 (美)Web Form Design Filling in the Blanks
Writing better code
1.
Writing Better Code
袁川 2010/12 yuanchuan@yqsh.com
2.
一、编程风格 二、高效地使用工具 三、前端结构
3.
一、编程风格 1.
DRY原则 -- Don't Repeat Yourself 2. 命名清晰一致,缩进整齐统一 3. 少耦合,多正交 4. 适当的注释
4.
5.
命名方式不一致 ShowPosPara() getCallback()
applyInfo_Punch()
6.
神秘的数字 无意义的变量名
h, h2 间隙不够,可读性差
7.
Tab与空格混在一起
8.
吓人的 Tab 容易导致很难发现的bug
多余的属性 低效率
9.
改进后 CSS
10.
重复重复重复 一处改变,许多地方都要修改 增加新的操作困难
11.
改进1 :
把 ID 单独放在一边,避免耦合
12.
改进2 :
简写代码
13.
改进3 :
信息隐藏
14.
Q: 为什么要关心程序风格? A
developer who doesn't care about style is like an artist, a painter, who doesn't care about color. ---- Brian Ensink Wiki : http://192.168.1.69/styles/js/ http://192.168.1.69/styles/css/
15.
二、高效地使用工具 1.
调试工具 2. 源代码管理工具, svn, git 等等 3. 编辑器,IDE
16.
三、前端结构 1.
原则 a. 做到 html(内容) css(表现) javascript(行为) 相分离 b. 向web标准靠拢 c. 保持良好的性能
17.
2. 当前系统的层次关系
App App App App 树结构 弹出窗口 Grid 日期选择框, jQuery扩展 .... 公共组件 DOM选择器 事件模型 ajax封装 动画效果 实用工具 .... 基础库 jQuery IE6/IE8/FF/Chrome/Safari/..
18.
3. 缺少的关键部分
---- 封装良好的 程序核心 目前出现的问题: 扩展困难 名称空间混乱 API不统一 无代码规范,难以维护 复用困难 复杂性在增长
19.
4. 建立核心框架与公共组件
UI库 Debug工具 数据验证工具 aiocp 数据存储 通信接口 其它扩展 ...... 任务不是想象当中的简单,需要大家一起努力
20.
aiocp.console
21.
分享技巧 http://www.slideshare.net/paul.irish/perfcompression
22.
谢谢!
Download now