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項必修法則
290
| 第卅一章:更聰明,而不是更辛苦
事實上,比較聰明的做法,是快點開始,並且在痛苦還很小的時候就面對它。早點整合
小段的程式碼比較簡單,接著時常整合後續的修改,而不是花費一年的時間在處理三項
主要的功能,在快要結束時,再試著把它們兜在一起。
單位測試也一樣:在寫程式的同時編寫測試程式(或之前)。等到程式可以“動”的時
候再來寫測試程式,將會比較難,而且比較沒有生產力。
有道是:
如果痛,就更常做
自動化
記得精典的忠告:
如果有件事你必須做一次以上,請編寫指令碼來幫你做。
重點
果你經常做某事,讓電腦為你做。使用指令碼來將它自動化。
將常做、繁瑣的工作自動化,可以節省你好幾個小時的工作。也考慮具有高度重複性質
的單一工作。編寫一個工具來一次執行,可能比你自己手動做重複的工作還要快速。
這種自動化有一個附加價值:它也可以協助他們人更聰明地工作。如果你可以用
一個
令來組建程式,而不是一連串 15 個複雜的指令與按鈕,就可以讓整個團隊更輕鬆地組
建,新人也可以更快上手。
為了做到這種自動化,有經驗的程式員自然會選擇可自動化的工具,就算他們目前還沒
有想要將任何東西自動化。他們比較喜歡產生純文字或簡單結構化中介檔案(例如,
JSON XML)的工作流程。選擇具備指令列介面及(或者,取代)固定式的 GUI
板。[Page-278]
有時你很難判斷某項工作是否需要編寫指令碼。顯然,如果你有可能多次執行一項工
作,就值得你考慮。除非指令碼特別難寫,否則你不太可能會浪費時間在上面。
錯誤預防
盡早發現錯誤,如此你就不需要花太多時間做錯誤的事情。 ...
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