Li-Wen Hsu’s Blog

June 29th, 2007

Tools

It is impossible to sharpen a pencil with a blunt ax. It is equally vain to try to do it with ten blunt axes instead.
Edsger W. Dijkstra

Dijkstra 資工系的同學一定都不陌生,講到最短路徑問題,一定都會提到他的 Dijkstra’s algorithm
還有 Floyd–Warshall algorithm。當然,Bellman-Ford algorithm 也很重要,
因為在 Dijkstra 的方法中,不允許負邊存在。
(上面的「陌生」要擺個 link 到國語辭典去的原因是,原來我已經廢到連是那個「陌」都想不起來了…)

dds@ (Diomidis D. Spinellis) 的 blog 看到這篇 The Tools we Use [1]

dds@ 是 Code Quality: The Open Source PerspectiveCode Reading: The Open Source Perspective 的作者,
看起來都是相當值得一讀的好書。
Code Reading 好不容易排隊借了回來,但是只看完第一章就一直丟在旁邊了。
今天發現後面又有人預約,看來又要重新排一次隊了…
而 Code Quality 這本在我連推薦了三次之後,我們的浩然終於在六月20日發訂了…
(隔壁王水大圖書館早在四月24日發訂了,但是是過了兩個月還是在發訂中…照這樣的處理速度…民國那一年才會看到書阿 @_@
真讓人有點想就敗下去了…Code Quality, Code Reading,必竟也好久沒有買書了,把錢花在這也比買糟糕物好得多。)

說了這麼多不太相關的東西,來談談 dds@ 的這篇文章吧,
首先他拿出了一張圓餅圖,展示了在 FreeBSD ports 裡面的軟體要 build 起來需要用那些工具,還有執行多久。
原來之前他在 -arch@-hackers@ 討論關於 Process accounting changes
acct(5) 的精確度從 15ms 調到 1ms 是是為了要做這個實驗阿(當然也有可能是相反過來,做完了這個以後才想找個東西來實測看看。
不過我相信,任何 work 都會有他的動機在,就算是 just for fun,也是很棒的阿! :-)

第二段的一句相當有意思:

Using a shiny IDE on top of 1970’s technologies is equivalent to wearing an iPod while ox-ploughing: the work becomes less burdensome, but we’re unlikely to reap substantial productivity improvements from such a change.

所以在後面他說只有把 abstraction 的程度提高,才是真正增加生產力的方法。

在文中他也提到了 C++ compiler 平均一次執行的時間是 1.6s,遠比 C 的 0.17s 多,代表了隨著技術的進步,
電腦和人腦的 trade off 越來越不平衡。也就是說,人可以越來越懶?或著是說,人可以把更多的心思花在更深層的思考上,
旁枝末節的苦工,就交給電腦去做吧。就像唐鳳說過的「大巧不工」— 「最巧妙的程式,就是不用寫程式的程式」。
所以 Perl 像強力膠一樣把 CPAN 黏在一起,而大家也像是吸了強力膠一樣,為 perl 深深著迷。

dds@ 說:

However, nowadays CPU power is a resource a) we can afford to use and b) we can’t afford not to use.

其實我們的聖杯戰爭也一樣,人腦強的是 symbolic reasoning 的能力,
歸納出方法之後,交由電腦的 concrete execution 去完成我們想的工作。這也是電腦科學中,演算法令人著迷的地方。
(為什麼我會想到求婚大作戰中那個妖精說的:「祈願吧,說出來我就替你實現!」呢?哈利露亞~thesis~ XD)

上過 Compiler 課的同學應該都聽老師講過這個故事:

Two success stories of the 1970s that raised the level of abstraction for a specific domain were Stephen Johnson’s parser generator yacc, and Michael Lesk’s lexical analyzer generator lex. Together these two tools and the theory behind them transformed the task of writing a compiler from wizardry into a standard rite of passage for computer science undergraduates.

yacc 和 lex 就是 abstraction 提高生產力最好的例子。

另外這也道出了,科學家和工程師另人著迷的地方,就是讓不可能成為可能,最後變成我們生活的一部份。
Google 說的 R==D 這種態度才是對的阿!)

最後,每次提到 tools 相關的東西,就一定會想到 gugod 的 talk: 利器善事。這是 OSDC.tw 2006 中,我最喜歡的一場。那句結語令我印象深刻:(沒錯,我又忘了是那個「象」了…)

Teach your tools to teach you to do the right thing.

說了這麼多(而且覺得好亂好沒內容 @@…) 還是乖乖回去造我的輪子吧…


[1] Diomidis Spinellis. The Tools we Use. IEEE Software, 24(4):20–21, July/August 2007

Filed under: Murmuring, Research, Computer, Programming — lwhsu @ 06:27

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress