創作者的 Unix 哲學
Eric S. Raymond 在 The Art of Unix Programming 這本書裡,列出了 Unix 程式設計的 17 條哲學。
但我覺得這根本不是在講程式設計,而是寫給所有創作者的行為準則啊!以下只挑一些我特別有共鳴的來講,有興趣讀完整 17 條原文的,按下方展開。
按這裡展開原文
- Rule of Modularity: Write simple parts connected by clean interfaces.
- Rule of Clarity: Clarity is better than cleverness.
- Rule of Composition: Design programs to be connected to other programs.
- Rule of Separation: Separate policy from mechanism; separate interfaces from engines.
- Rule of Simplicity: Design for simplicity; add complexity only where you must.
- Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.
- Rule of Transparency: Design for visibility to make inspection and debugging easier.
- Rule of Robustness: Robustness is the child of transparency and simplicity.
- Rule of Representation: Fold knowledge into data so program logic can be stupid and robust.
- Rule of Least Surprise: In interface design, always do the least surprising thing.
- Rule of Silence: When a program has nothing surprising to say, it should say nothing.
- Rule of Repair: When you must fail, fail noisily and as soon as possible.
- Rule of Economy: Programmer time is expensive; conserve it in preference to machine time.
- Rule of Generation: Avoid hand-hacking; write programs to write programs when you can.
- Rule of Optimization: Prototype before polishing. Get it working before you optimize it.
- Rule of Diversity: Distrust all claims for "one true way".
- Rule of Extensibility: Design for the future, because it will be here sooner than you think.
分離原則
"4. Rule of Separation: Separate policy from mechanism; separate interfaces from engines."
(分離原則:把政策和機制分開;把介面和引擎分開。)
套用到創作上面,簡單來說就是把「你想講的話」跟「你用來講話的工具」分開。
不要特別為了平台,來量身訂做你想講的東西。當你開始想「開頭五秒要放什麼才不會被滑掉」、「什麼時候上傳觸及率比較高」、「這個詞會不會被黃標」、「這個演算法會推嗎」⋯⋯這時傳達的訊息就已經被工具改寫了。
訊息應該要凌駕於工具之上,而且隨時能被轉化成任何格式。
如果非要選一種「終極格式」,我想純文字是最好的選擇。
節儉原則
"6. Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do."
(節儉原則:除非能證明別無他法,否則不要寫大程式。)
不要鋪張、不要搞一堆有的沒有的來擾亂自己。
你真的需要這麼複雜的企劃、這麼多人的團隊、這麼多攝影機角度、這麼繁複的剪輯嗎?如果無法證明「真的非得要這樣不可,沒有別的辦法」,那就把這些贅肉通通砍掉吧!
資料原則
"9. Rule of Representation: Fold knowledge into data so program logic can be stupid and robust."
(資料原則:把知識放進資料裡,所以程式邏輯可以又笨又耐用。)
讓「內容」去變化就好,而不是「流程」。流程要盡量簡單、耐用就好,不要每天變來變去。
例如這個部落格,我每天上傳的流程都是一樣的──寫一個 Markdown 檔案,丟進資料夾,npm run build,上傳──因為流程既無聊又簡單,我才能專注在每天寫的主題上,而不是跟流程搏鬥。
做音樂也一樣:只要有一台不錯的音源機,就能做出幾乎所有類型的音樂。不需要一直更新編曲軟體到最新版,也不需要下載 500 GB 的音色庫,更不需要糾結那十五種 compressor 的聲音到底差在哪裡。
沉默原則
"11. Rule of Silence: When a program has nothing surprising to say, it should say nothing."
(沉默原則:如果沒有有趣的東西可講,就不要講。)
現在的內容生態,根本是朝完全相反的方向運作──明明就沒有東西講,但每個人還是強迫自己一直發限動、刷存在感、餵演算法。
最佳化原則
"15. Rule of Optimization: Prototype before polishing. Get it working before you optimize it."
(最佳化原則:先讓它能用,再慢慢打磨。)
這是許多新手創作者最常犯的錯誤:根本什麼都還沒開始做,就先擔心要買什麼鏡頭、哪隻麥克風、Logo 要找誰設計、紅了以後怎麼應付酸民⋯⋯想太多了啦,先把第一集拍出來再說好不好!
擴充原則
"17. Rule of Extensibility: Design for the future, because it will be here sooner than you think."
(擴充原則:為未來設計,因為未來來得比你想的還快。)
這點我太認同了!擁有自己的網站、自己的網域、掌握作品的主權與跟讀者直接聯絡的管道,在未來只會越來越重要。
平台收割韭菜的速度,絕對比你想像中還要快。那日漸萎縮的觸及率,就是「未來」即將到來的徵兆呀!