Submit Search
Upload
注重实效的编程(3)
•
Download as PPT, PDF
•
0 likes
•
699 views
Horky Chen
Follow
应对变化: 解耦:得墨忒尔法则 元数据与动态配置 并发与次序 划分模块、分而治之 编码时 不要靠巧合编程 代码需要演化:重构 编写易于测试的代码
Read less
Read more
Technology
Report
Share
Report
Share
1 of 12
Download now
Recommended
Node cluster
Node cluster
aleafs
第五项修炼 (学习型组织的艺术与实践)
第五项修炼 (学习型组织的艺术与实践)
Horky Chen
12 Days of Twismas
12 Days of Twismas
Barry Feldman
创聊才智
创聊才智
杰丰 余
注重实效的编程(1)
注重实效的编程(1)
Horky Chen
5个简单技巧学创新
5个简单技巧学创新
杰丰 余
First Contact HR Core Components of an Employment Background Check
First Contact HR Core Components of an Employment Background Check
Leon Singletary, SPHR, SHRM-SCP
Geeker consulting presentation
Geeker consulting presentation
Geeker Consulting Limited
Recommended
Node cluster
Node cluster
aleafs
第五项修炼 (学习型组织的艺术与实践)
第五项修炼 (学习型组织的艺术与实践)
Horky Chen
12 Days of Twismas
12 Days of Twismas
Barry Feldman
创聊才智
创聊才智
杰丰 余
注重实效的编程(1)
注重实效的编程(1)
Horky Chen
5个简单技巧学创新
5个简单技巧学创新
杰丰 余
First Contact HR Core Components of an Employment Background Check
First Contact HR Core Components of an Employment Background Check
Leon Singletary, SPHR, SHRM-SCP
Geeker consulting presentation
Geeker consulting presentation
Geeker Consulting Limited
Google模式速览
Google模式速览
杰丰 余
我读《联盟》第一季
我读《联盟》第一季
杰丰 余
Jobmet total solution
Jobmet total solution
Jobmetbryanwu
程序员发展漫谈
程序员发展漫谈
Horky Chen
Google和apple招聘的那些事
Google和apple招聘的那些事
杰丰 余
注重实效的编程(2)
注重实效的编程(2)
Horky Chen
21 Tweets for Beginners
21 Tweets for Beginners
Barry Feldman
我读《Google模式》全集
我读《Google模式》全集
杰丰 余
Social+digital+mobile recruiting-and-employer-branding-in-china2
Social+digital+mobile recruiting-and-employer-branding-in-china2
Au yung
大数据人才招聘
大数据人才招聘
杰丰 余
巧用佣金配合战略
巧用佣金配合战略
杰丰 余
Waterville Talent Platform 华迪人才管理系统 2012
Waterville Talent Platform 华迪人才管理系统 2012
y_james_song
Stabbing Mediocrity to Death
Stabbing Mediocrity to Death
Barry Feldman
How to Assemble a Results-Driven B2B Marketing Team
How to Assemble a Results-Driven B2B Marketing Team
Uberflip
Solar Systems By Tecso Projects Limited, Vadodara
Solar Systems By Tecso Projects Limited, Vadodara
IndiaMART InterMESH Limited
Rock and Roll Content: Creating Big Hits
Rock and Roll Content: Creating Big Hits
Barry Feldman
The Anatomy of The Perfect Coffee Break
The Anatomy of The Perfect Coffee Break
Èspresso1882 Australia
编程语言与自然语言
编程语言与自然语言
Horky Chen
Tow points of WebKit in design
Tow points of WebKit in design
Horky Chen
代码大全(内训)
代码大全(内训)
Horky Chen
程序员实践之路
程序员实践之路
Horky Chen
Java scriptcore brief introduction
Java scriptcore brief introduction
Horky Chen
More Related Content
Viewers also liked
Google模式速览
Google模式速览
杰丰 余
我读《联盟》第一季
我读《联盟》第一季
杰丰 余
Jobmet total solution
Jobmet total solution
Jobmetbryanwu
程序员发展漫谈
程序员发展漫谈
Horky Chen
Google和apple招聘的那些事
Google和apple招聘的那些事
杰丰 余
注重实效的编程(2)
注重实效的编程(2)
Horky Chen
21 Tweets for Beginners
21 Tweets for Beginners
Barry Feldman
我读《Google模式》全集
我读《Google模式》全集
杰丰 余
Social+digital+mobile recruiting-and-employer-branding-in-china2
Social+digital+mobile recruiting-and-employer-branding-in-china2
Au yung
大数据人才招聘
大数据人才招聘
杰丰 余
巧用佣金配合战略
巧用佣金配合战略
杰丰 余
Waterville Talent Platform 华迪人才管理系统 2012
Waterville Talent Platform 华迪人才管理系统 2012
y_james_song
Stabbing Mediocrity to Death
Stabbing Mediocrity to Death
Barry Feldman
How to Assemble a Results-Driven B2B Marketing Team
How to Assemble a Results-Driven B2B Marketing Team
Uberflip
Solar Systems By Tecso Projects Limited, Vadodara
Solar Systems By Tecso Projects Limited, Vadodara
IndiaMART InterMESH Limited
Rock and Roll Content: Creating Big Hits
Rock and Roll Content: Creating Big Hits
Barry Feldman
The Anatomy of The Perfect Coffee Break
The Anatomy of The Perfect Coffee Break
Èspresso1882 Australia
Viewers also liked
(17)
Google模式速览
Google模式速览
我读《联盟》第一季
我读《联盟》第一季
Jobmet total solution
Jobmet total solution
程序员发展漫谈
程序员发展漫谈
Google和apple招聘的那些事
Google和apple招聘的那些事
注重实效的编程(2)
注重实效的编程(2)
21 Tweets for Beginners
21 Tweets for Beginners
我读《Google模式》全集
我读《Google模式》全集
Social+digital+mobile recruiting-and-employer-branding-in-china2
Social+digital+mobile recruiting-and-employer-branding-in-china2
大数据人才招聘
大数据人才招聘
巧用佣金配合战略
巧用佣金配合战略
Waterville Talent Platform 华迪人才管理系统 2012
Waterville Talent Platform 华迪人才管理系统 2012
Stabbing Mediocrity to Death
Stabbing Mediocrity to Death
How to Assemble a Results-Driven B2B Marketing Team
How to Assemble a Results-Driven B2B Marketing Team
Solar Systems By Tecso Projects Limited, Vadodara
Solar Systems By Tecso Projects Limited, Vadodara
Rock and Roll Content: Creating Big Hits
Rock and Roll Content: Creating Big Hits
The Anatomy of The Perfect Coffee Break
The Anatomy of The Perfect Coffee Break
More from Horky Chen
编程语言与自然语言
编程语言与自然语言
Horky Chen
Tow points of WebKit in design
Tow points of WebKit in design
Horky Chen
代码大全(内训)
代码大全(内训)
Horky Chen
程序员实践之路
程序员实践之路
Horky Chen
Java scriptcore brief introduction
Java scriptcore brief introduction
Horky Chen
JavaScript closures
JavaScript closures
Horky Chen
More from Horky Chen
(6)
编程语言与自然语言
编程语言与自然语言
Tow points of WebKit in design
Tow points of WebKit in design
代码大全(内训)
代码大全(内训)
程序员实践之路
程序员实践之路
Java scriptcore brief introduction
Java scriptcore brief introduction
JavaScript closures
JavaScript closures
注重实效的编程(3)
1.
弯曲,或者折断 效 程实 编
3 Horky 7/Jun,2010 http://blog.csdn.net/horkychen 1
2.
Keywords • 化应对变 : –
解耦 : 得墨忒尔法则 – 元数据与 配置动态 – 并 与次序发 – 分模 、分而治之划 块 • 编码时 – 不要靠巧合 程编 – 代 需要演化:重码 构 – 写易于 的代编 测试 码 2
3.
得墨忒尔法则 (Demeter) • 某个对象的任何方法都应该只能调用: –
它自身 – 传入该方法的任何参数 – 它创建的任何对象 – 任何直接持有的组件对象 3
4.
元数据与动态配置 • 将变化封装起来,使用元数据进行配置。 – 什么是变化的? –
什么是不变化的? – 抽象、抽象 4
5.
并发与时序 • 时间耦合( temporal
coupling) – 定义好你的工作流 – 用服务为并发进行设计 – Windows COM+ 技术解说 5
6.
分而治之 • 观察者模式 6
7.
靠巧合编程 • 有时我们不知道为什么代码会有问题,因为我 们都不知道它为什么能工作。 • 几项注意: –
它也许只是看起来能工作 – 你依靠的边界条件也许只是一个偶然 – 没有记入文档的行为可能会产生不必要的依赖 – 多余的和不必要的调用会成为代码的负担 – 多余的调用还会增加引入 BUG 的风险 • 简洁且高效的代码是我们的目标 • 在文档记录各种假定。大胆假设、小心论证。 7
8.
深思熟虑的编程 • 总是意识到你在做什么 • 不要盲目地编程 •
按照计划行事 • 依据可靠的事物,不要依靠巧合和假定 • 为你的假定建立文档。(异常处理和断言) • 不要只是测试你的代码,还要测试你的假定 • 为你的工作划分优先级 • 不要做历史的奴隶。不要让已有代码支配未来 的代码 8
9.
代码需要演化 • 软件工程师与建筑师 • 软件工程师与园丁 9
10.
如何进行重构 • 重构需要慎重、小心进行的活动,也需要 勇气: – 不要试图在重构的同时增加新功能。 –
在开始之前,确保你拥有良好的测试。 – 采取短小、深思熟虑的步骤进行重构。 10
11.
易于测试的代码 • 测试是 R&D
的责任! • 保证我们清楚我们在做什么,并且做好了 。 – 单元测试及回归测试 – 例如 :Perl 的编译支持 • make test 进行回归测试 • 测试驱动开发 – ZOLO 4 将要求工程师在编写 FS 时生成 Check list 11
12.
Q&A 12
Download now