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項必修法則
第十章
獵殺 Bug
如果除錯是去除軟體
bug
的流程,
編寫程式必定是把它放入的流程。
- Edsger Dijkstra
這是開放的季節,一個持續一整年的季節。不需要許可證,沒有任何限制。請自己帶著
短槍,進入開放的軟體原野,徹底去除那些令人討厭的惡棍、讓人難以捉摸的
bug
,打
扁它們,讓它們死。
OK,事實不是這麼美好。但有時你會遇到成群結隊的 bug 聯合起來對付你的程式碼。
散彈槍是唯一的回應。
有一個老故事是這麼說的:程式員編寫程式。程式員不完美。程式員的程式不完美。因
此它的第一次不會完美地運作。所以我們有 bug 75
如果我們培養更好的程式員,顯然我們會培養更好的 bug
有一些 bug 是簡單的錯誤,很容易找到並修改。當我們遇到這種 bug 時,代表我們很幸
運。
大部分的 bug(會讓我們花費好幾個小時的努力來追蹤,同時讓毛囊與頭髮色素細胞死
去)是令人討厭的微細問題。它們會很奇怪地互動且令人驚訝,會讓演算法產生出人意
料的結果,讓看起來很簡單的軟體產生無法預知的行為。它肯定被搗蛋鬼附身了。
這個問題並非只限於新手程式員,專家也很容易發生。我們的工藝先軀也蒙受痛苦,傑
出的電腦科學家 Maurice Wilkes 曾說:我清楚地記得
[...]
我在
EDSAC
室與打孔設備之
82
| ...
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