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項必修法則
第十二章
對付複雜
簡單是種美德,但它需要努力工作才能達成,
也需要經過教育才懂得欣賞。
而且更糟的是:複雜的東西賣得更好。
- Edsger Dijkstra
程式碼很複雜。複雜度是我們每天都必須參與的戰爭。
當然,你的程式很棒,不是嗎?複雜的都是別人的程式碼。
嗯,不是的,並不一定如此。承認這一點。寫出複雜的東西太容易了。它會在你不注意
的時候發生。它會在你沒有預先充分計畫的時候發生。它會在發生在你準備處理一個
“簡單”的問題,很快發現有許多極端情況,讓你那個簡單的演算法變成一個迷宮,準
備坑殺不知情的程式員。
我的觀察是,複雜的軟體來自三個主要的原因:團狀物與直線。
110
| 第十二章:對付複雜
以及當你結合它們,就會得到:人。[Page-104]
在本章中,我們會逐一討論它們,並看看我們可以學到哪些編寫更好軟體的知識。
團狀物
關於軟體複雜度,我們要考慮的對象部分與
團狀物
有關:也就是,我們編寫的元件。這
些團狀物的大小與數目決定了複雜程度。
有一些軟體的複雜程度是因為大小而自然產生的,專案變得愈大,我們就需要愈多團狀
物,它就愈難理解,愈難共事。這是必要的複雜度。
但有許多沒必要的複雜度會產生麻煩。忘了有多少次,當我打開一個 C++ 標頭檔的時
候,因為看到單一類別宣告式中有上千行程式而呆住。一個凡人怎麼能知道這隻野獸到 ...
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