Skip to Content
成為卓越程式設計師的38項必修法則
book

成為卓越程式設計師的38項必修法則

by Pete Goodliffe
May 2015
Intermediate to advanced
376 pages
5h 48m
Chinese
GoTop Information, Inc.
Content preview from 成為卓越程式設計師的38項必修法則
第三章
少寫一點程式碼!
善用最小的事物,就足以處理所有事情!
- Jules Verne
環遊世界八十天
這件事很讓人難過,但它是真實的:在現代世界中,程式碼太多了。[Page-17]
我可以面對電腦控制我的車子引擎的事實。顯然在我的微波爐中,有一個軟體在煮食
物。就算我的基轉黃瓜裡面被嵌入一台微控制器,我也不意外。這些都還好,因為它們
不是我浸淫的事物。我擔心的是外面那些
沒必要
的程式碼。
有太多沒必要的程式碼到處晃蕩。這些邪惡的程式碼就像雜草一樣佔據珍貴的存儲位
元,混淆版本控制歷史,頑固地阻礙我們發展的路途,並佔用珍貴的程式碼空間,讓它
們四週的良好程式碼喘不過氣。
為什麼會有這麼多沒必要的程式碼?
有些人只喜歡聽自己講的話。你一定見過它們,你就是無法讓他們閉上嘴巴。這種人是
你在聚會中不想要碰到的。
Yada yada yada
(表示無聊的談話)。另外有些人很喜歡他們
自己的程式碼。他們真的太喜歡了,以致於大量地編寫:
{ yada->yada.yada(); }
或許他們有一個外行的主管,藉由檢視一天寫了幾千行程式來研判進度。
寫出許多程式碼,不代表寫出許多軟體。事實上,有一些程式碼會對軟體的品質產生負
面的影響—它會礙眼、產生錯誤,並降低使用者體驗的品質。這種編程方式相當於反物
質(antimatter)。
20
|
第三章:少寫一些程式碼!
重點
較少的程式碼可能代表更好的軟體。
在我的軟體改善工作中,有些很好的案例是藉由移除程式碼來完成的。我還很深刻地記
得,我曾經在一個龐大的系統裡面移除上千行程式,只用 ...
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

精通機器學習|使用Python

精通機器學習|使用Python

Sarah Guido, Andreas C. Mueller
Java性能优化实践:JVM调优策略、工具与技巧

Java性能优化实践:JVM调优策略、工具与技巧

Benjamin J. Evans, James Gough, Chris Newland

Publisher Resources

ISBN: 9789863475699