烦请拨冗审阅《驯服烂代码》前2章

4 views
Skip to first unread message

伍斌_Ben

unread,
Mar 18, 2014, 8:49:34 AM3/18/14
to scrumga...@googlegroups.com, agiles...@googlegroups.com
各位好!如果您对驯服烂代码感兴趣,不妨审阅一下附件中我写的《驯服烂代码》一书的前2章。我计划5月底写完。下面是该书大纲。期待您的反馈。谢 谢。

《驯服烂代码》大纲
第1章. “刻舟求剑”的文档:在使用传统瀑布方法进行kata-hotel-world-clocks编程操练中,暴露出其中的问题。

第2章. 何谓“驯服烂代码”:阐释驯服烂代码的概念。

第3章. 教其言而观其行:用测试先行的方法开发kata-hotel-world-clocks。

第4章. 若能守道则万物自宾:为kata-hotel-world-clocks添加新功能-在测试的保护下将kata-hotel-world-clocks重 构到Observer设计模式。

第5章. 三生万物:用Cucumber实现kata-fizzbuzz并重构到chain of responsibility设计模式。

第6章. 合理分权:在修复Trivia烂代码的bug的过程中,将一个大类分解到多个单一职责的小类。

第7章. 分而治之、各个击破:用编程操练Four Katas on a Racing-Car Theme来展示如何使用mock来解除某个类与其他类的耦合,并编写其测试代码。

第8章. 总结


-- 
Cheers
Bin WU (Ben) 伍斌
Software Craftsman, 独立匠艺程序员
wub...@gmail.com, (+86) 13911116027, wubinben.com, 微信wechat: bjdp_org

 
驯服烂代码-2014.03.18.pdf

lidong

unread,
Mar 18, 2014, 11:17:31 PM3/18/14
to scrumga...@googlegroups.com, scrumga...@googlegroups.com, agiles...@googlegroups.com
虽然不是程序员,不懂编程,但是看完之后很受益,每个词汇出处、注释以及结合有趣
的故事,体会到了伍斌老师的用心良苦,谢谢分享。期待……..



发件人: scrumga...@googlegroups.com [mailto:scrumgathering@googlegroups.
com] 代表 伍斌_Ben
发送时间: 2014年3月18日 20:50
收件人: scrumga...@googlegroups.com; agiles...@googlegroups.com
主题: 烦请拨冗审阅《驯服烂代码》前2章



各位好!如果您对驯服烂代码感兴趣,不妨审阅一下附件中我写的《驯服烂代码》一书
--
--
您收到此信息是由于您订阅了 Google 论坛“Scrum Gathering”论坛。
要在此论坛发帖,请发电子邮件到 scrumga...@googlegroups.com
要退订此论坛,请发邮件至 scrumgatherin...@googlegroups.com
更多选项,请通过 http://groups.google.com/group/scrumgathering?hl=en 访
问该论坛
网站: http://scrumgathering.cn
微博: http://weibo.com/scrumgathering

---
You received this message because you are subscribed to the Google Groups
"Scrum Gathering" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to scrumgatherin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

winmail.dat

Steven Mak

unread,
Mar 18, 2014, 11:36:09 PM3/18/14
to scrumga...@googlegroups.com, agiles...@googlegroups.com
Hi.... 就只有幾點

1. 文中的代碼如果有 Syntax highlighting 更好
2. 55 頁上的 SOLID 前文沒有介紹過
3. 同樣是 55 頁上面的 "測試驅動開發" 到 58 頁才介紹;另外就是最好統一使用,用TDD的話就全寫 TDD 好了,用測試驅動開發就全用測試驅動開發好了

其實 Ch 2 裡的東西都是 Working Effectively With Legacy Code / Test Driven Development 的東西,其實想帶出什麼新觀點呢?


伍斌_Ben

unread,
Mar 19, 2014, 10:25:03 AM3/19/14
to scrumga...@googlegroups.com, agiles...@googlegroups.com
Hi Steven

感谢您的回复,下面是我的答复,谢谢。

Ben

于 2014年03月19日 11:36, Steven Mak 写道:
Hi.... 就只有幾點

1. 文中的代碼如果有 Syntax highlighting 更好
[Ben]心有余而力不足。抱歉。

2. 55 頁上的 SOLID 前文沒有介紹過
[Ben]对。应该加上脚注。

3. 同樣是 55 頁上面的 "測試驅動開發" 到 58 頁才介紹;另外就是最好統一使用,用TDD的話就全寫 TDD 好了,用測試驅動開發就全用測試驅動開發好了
[Ben]好的,要改正。


其實 Ch 2 裡的東西都是 Working Effectively With Legacy Code / Test Driven Development 的東西,其實想帶出什麼新觀點呢?
[Ben]虽然王阳明说:“不求异于人,而求同于理。”但我个人觉得第2章还是有两点新的东西:1)将烂代码的概念从“没有测试”扩展为“反馈迟 缓”,从而既包含没有测试导致了解代码行为迟缓,又包含了命名不好导致的理解代码迟缓等问题。2)有像孙悟空、小灰灰这样的适合本土文化的比喻。

申健Jacky

unread,
Apr 17, 2014, 2:59:38 AM4/17/14
to agiles...@googlegroups.com, scrumga...@googlegroups.com
Hi, Ben

我回复得有点慢了。



关于烂代码定义,似乎需要修改bug并不是那么主要的一点,好代码也会有bug的。
除了没有测试,我一般会总结成2点:不可读、难以维护和修改

关于TDD的优劣,其实设计的思路是一个难以转变的跨越,专注和复用的说明显得稍微单薄了一些。

关于习惯的那部分故事还是不错的,只是感觉第二章里面,烂代码与习惯的比例还可以再调整一下,重点再突出一些。

Br,
申健Jacky Shen
个人网站:www.JackyShen.com







-- 
您收到此邮件是因为您订阅了Google网上论坛中的“agileshanghai”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到agileshangha...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

Reply all
Reply to author
Forward
0 new messages