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堂成长课
开动脑筋
135
17.3
 你可以思考
Use your brain
”是一条赋予权力的规则。你是
允许
使用大脑的,某种程度上这种行为甚
至是被鼓励的。
有些程序员没有承担起应有的责任。他们凭本能编程,仅仅是在做填补别人设计中的空白
的工作,或者遵循现有的结构和惯用法,仿佛没有思考的能力。
你不是编码机器。你有大脑,请使用它!
当你面对一段代码时,通过思考来决定它的结构。你
拥有
这些代码,要对它负起责任。积
极主动地做出决策,进行必要的改善和修正。
如果现有的代码模式有问题,请斟酌是否应该修正它们,仔细判断现在是否是重构的正确
时机。
如果发现代码中充斥着创可贴式的修复,不要效仿,不要在应当进行深度的代码调整时退
缩,不要再添加一片创可贴。要明白,解决这类问题是
你的责任
。你可以严格地评估已有
代码。
你需要勇气来拥有一个观点,并且能够表达它。让代码变得更好的东西值得你坚持和
拥护。
要诀
勇于开动脑筋思考。你有权利也有能力对代码进行评判,并就如何改
进做出决策。
思考题
1.
简单
代码和
愚蠢
代码的区别是什么?
2.
如何确保不编写愚蠢的代码?你能凭“直觉”判断良好的代码吗?如何证明?
3.
有什么迹象可以表明编写代码的人没有用心?
4.
在选择是将一段糟糕的代码进行重写,还是“务实”地将其标记为技术债然后退出时,
需要考虑哪些因素?
拓展阅读
15
章讲述了“开动脑筋”是我的团队所遵循的三条互补规则之一。
33
章是案例研究,介绍了在什么时候退后一步并从全局思考。
立刻行动
工作时集中注意力。现在,选择两种方法来让自己保持专注,避免编写愚蠢的代码。 ...
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