Skip to Content
程序员的38堂成长课
book

程序员的38堂成长课

by Pete Goodliffe
January 2022
Beginner to intermediate
314 pages
6h 55m
Chinese
Posts & Telecom Press
Content preview from 程序员的38堂成长课
138
18
要诀
不要试图让代码不可改变。如果产品中有不可更改的代码,那么产品
就会腐化。
当最初的作者离开项目,没有人完全理解对业务关键的遗留代码时,我们就会看到死亡
僵硬的状态。当遗留代码难以修改,甚至无法对遗留代码做出可靠的估计时,程序员会
避开代码的核心地带。从此它会变成一个不受拘束的“代码荒原”,在那里,“数字野兽”
无拘无束地游荡。为了以一种及时和可预测的方式工作,新的功能被作为卫星模块添加
在系统的边缘。
当产品被发布到生产服务器上,每天都有许多客户端使用时,我们也会看到死亡僵硬的状
态。最初的系统
API
之所以仍然被广泛使用,是因为更改它们成本太高,不过,现在仍然
有许多其他团队或服务依赖于它们。
代码
绝对
不应该静止不动。没有代码是神圣的,也没有代码是完美的,它怎么会静止不动
呢?软件周边的世界在不断变化。无论最初是如何煞费苦心地确认需求,需求总是处于不
断变化的状态。产品版本
2.4
与版本
1.6
的差异如此之大,以至于内部代码结构
有可能
全不同。我们总是在旧代码中发现需要修复的新
bug
当代码变成一种束缚时,你
不是
在开发它,而是在与之斗争。你将永远围绕着坏死的逻辑
跳舞,围绕着不可靠的设计来进行更加晦涩难懂的规划。
要诀
你是软件的主人,一切尽在你的掌握之中。不要让代码或流程来决定
项目如何发展。
18.1
 大胆地改
当然,害怕对软件造成破坏是无可厚非的。大型软件项目包含许多必须掌握的细微之处和
复杂性。谁都不想由于修改过于草率而引入
bug
。没有人希望在不明就里的情况下贸然做
出变更。那是不负责任的编码方式。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
Python应用开发指南

Python应用开发指南

Posts & Telecom Press, Ninad Sathaye
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115577948