
修改代码的艺术
Working effectively with legacy code
Michael C. Feathers · 初版 2004 年
186人推荐
234位读者提及
315次提及
为什么值得读
- 核心在于为混乱系统补全测试以辅助理解
- 章节针对代码缺乏结构等痛点场景提供解法
- 帮助开发者在不重写的前提下平稳改善老代码
Hacker News 上怎么说
正在加载完整评论……

Working effectively with legacy code
Michael C. Feathers · 初版 2004 年
正在加载完整评论……
……如果提问者用的是 JavaScript,Martin Fowler 出过《重构》的第二版,里面换成了 JS 代码,可能会有用。我没读过第一版(Java 版的),但 Michael Feathers 的《修改代码的艺术》(Working Effectively With Legacy Code)是我经常推荐的书。它的核心目标是让你那一堆烂摊子代码受测试保护,理想情况下,这些测试既能帮你理解系统,又能提升系统质量。整本书是以一连串问题的形式组织的……
…the questioner is working in JavaScript, Martin Fowler came out with a second edition of Refactoring with JS code that might be useful. I've never read the first edition (in Java) but Michael Feathers' Working Effectively With Legacy Code is a frequent recommendation of mine. Its main goal is to get your mess under test, ideally tests that help you understand the system as well as improve its quality. It's organized as a set of questions…
……他们自己也不知道更好的做法;他们接手的可能本身就是个烂摊子,而且可能一直承受着不惜一切代价快速交付的压力——又或者他们只是不懂,但心里其实想改进。去读读这几本书吧:Michael Feathers 的《修改代码的艺术》、Martin Fowler 的《重构:改善既有代码的设计》、Uncle Bob 的《代码整洁之道》。这些都是无价之宝。还有很多其他的,但唯独这三本尤为……
…know better; they may have inherited a mess too, and they may have been under pressure to deliver quickly at any cost--or maybe they just don't know any better, but want to improve. Read these books: _Working Effectively with Legacy Code_ by Michael Feathers _Refactoring: Improving the Design of Existing Code_ by Martin Fowler _Clean Code_ by Uncle Bob These are invaluable resources. There are many others, but these three are particularly…
……领域驱动设计(Domain Driven Design)* 《设计模式:可复用面向对象软件的基础》* Kent Beck - 《解析极限编程》* Kent Beck - 《规划极限编程》* Michael C. Feathers - 《修改代码的艺术》* 丹尼尔·卡尼曼 - 《思考,快与慢》[编辑] 修正了遗留代码那本书的作者
…Domain Driven Design * Design Patterns: Elements of Reusable Object-Oriented Software * Kent Beck - Extreme Programming Explained * Kent Beck - Planning Extreme Programming * Michael C. Feathers - Working Effectively with Legacy Code * Daniel Kahneman - Thinking, Fast and Slow [EDIT] Correct the author for legacy code
有一本书叫《修改代码的艺术》,作者是 Michael C. Feathers,我打心底里强烈推荐。之前我在维护一个听起来差不多的代码库时买过,非常管用。书里有些章节标题像“我的程序完全没有架构”之类的……
There's a book called "Working Effectively with Legacy Code" by Michael C. Feathers which I heartily recommend. I got it a while back when working on a similar sounding codebase and it was very useful. It's got chapter headings like "My Application Has No Structure"…
我先说一句,我对推倒重写(rewrite)从没遇到过什么好体验,这些经历让我对重写极其反感。Michael Feathers 的《修改代码的艺术》真的帮我熬过了类似的困境。我的建议是,先不要试图去理解代码本身,而是去搞清楚这段代码在服务什么业务、被谁使用。……
I'll open by saying I've only ever had bad experiences with complete re-writes and these experiences have impacted my aversion to them. "[Working Effectively with Legacy Code]" by Michael Feathers really helped me get through a situation like this. My recommendation is not to try to understand the code per se, but understand the business that the code was being used in/by.…
……用 AstroGrep(http://astrogrep.sourceforge.net/)在代码库里快速搜索和跳转,或者在任何系统上我都会用 VS Code 来做类似的事情。另外也要学着用命令行的 find 和 grep。《修改代码的艺术》这本书也让我更自如地在大型代码库中穿梭和修改代码,长远来看,我向每一位开发者推荐这本书 https://www.amazon.co.uk/Working-Effectively-Legacy-Michael-...……
…AstroGrep http://astrogrep.sourceforge.net/ to quickly search and jump around in the code or in any system I use VS Code for a similar functionality. Also learn to use command line find/grep. The book "Working Effectively with Legacy Code" also helped me be more comfortable navigating and changing large code bases, in a long term view I recommend this book to every developer https://www.amazon.co.uk/Working-Effectively-Legacy-Michael-...…