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堂成长课
没有一成不变
141
一套好的自动化测试可以让你工作得又快又好。关于修改是否造成了破坏,自动化测试能
够使你获得快速、可靠的反馈。考虑为你的代码段引入某种可验证的测试,以避免错误。
正如代码可以从责任感和仔细的评审过程中获益一样,测试也可以达到同样的效果。
要诀
自动化测试是一个极为有益的安全工具,可以帮助你建立对代码修改
的信心。
开发的主干应该是
持续集成
:一台不断签出新版本代码并进行构建的服务器。如果有什么
不好的东西溜进代码库来造成破坏,导致构建失败,你将很快发现它。自动化测试也应该
在构建服务器上运行。
18.3.3
 慎重地选择战场
没有什么是一成不变的,但也不是所有的东西都应该流动不息。
所以,应该选择自己的战场。我们不可能每时每刻都更改已有代码,同时添加更多的新功
能。我们总会发现不那么令人愉快的代码,但是不论多么渴望,不能立即修复它们。工作
量太大了,可能已经超出了大规模重构的范围。
在有机会做出改进之前,需要一直背负着这些技术债。它们应该被放回到项目计划中重新
考虑。重要的债务应该成为开发路线图上的工作项,而不是被遗忘,任其恶化。
18.4
 万变不离其宗
谁能处理不断变化的代码呢?这听起来像一场噩梦跟踪许多同时变化的代码已经足够困
难,更不用说一起修改它们了。
然而,我们必须接受代码变更的事实:任何静止不动的代码都是一种负担。没有代码是不
能修改的。对一段代码恐惧到能躲就躲恐怕会适得其反。
思考题
1.
什么特性使得软件易于更改?你总能编写这样的软件吗?
2.
如何平衡“没有代码所有权”和一些人更有经验这两个事实?这将如何影响程序员的任 ...
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