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堂成长课
15
3
写更少的代码
一个被广泛使用的最小值就足够了。
——儒勒
凡尔纳
《八十天环游地球》
一个可悲的事实摆在我们面前:当今社会,代码过剩了。
我的汽车发动机被计算机控制着,用于烹饪的微波炉也被计算机控制着。如果有一天你和
我说,我吃的转基因黄瓜里面有一个微型控制器,我也不会大惊小怪。这都可以接受,我
所担心的是在无所不在的软件当中有浩如烟海的代码,而其中很多代码是
多余
的。
这些多余的代码就像野草一样,四处蔓延,填满了我们的存储器,搅乱了版本控制系统的
历史记录,异常顽固地挡在我们的开发之路上。它们在源代码中到处游荡,使周围优秀的
代码不堪重负。
为什么多余的代码如此繁多?
在生活中,有些人热衷于表现自己。你遇到他们,他们的话匣子就关不上了。在聚会中遇
到时,你会被他们拉住不得脱身,不得不忍受他们的连篇废话。在编写代码时,有些人也
热衷于表现自己,他们会写下不计其数的无用代码:
{ yada->yada.yada(); }
也许他们只是误入歧途,因为他们的顶头上司要用每天写了多少行代码来衡量其工作
效率。
写了很多代码并不等同于写了很多软件。实际上,很多时候这么做就是南辕北辙,起到了
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