星期六, 7月 04, 2009

Thinking in Java

http://www.mindview.net/Books/TIJ/

蠻早以前就聽過 Bruce Eckel 和他 Thinking in XXXX 系列書籍。Bruce 是少數在寫稿的過程當中,願意把草稿開放出來讓人下載的無私作者,並藉此和讀者們互動,瞭解讀者們的意見。

過去一直不明白為啥這系列書籍這麼受到大家推崇,總以為有了『The C++ Programming Language』、『C++ Primer』就不需要再多花時間去看其他的 C++ 書籍。直到最近拿 Thinking in Java 來讀,光看第一章就讓我讚嘆不已,邊讀邊想,點頭如搗蒜。

有這麼神奇嗎?嗯,這樣說吧,『The C++ Programming Language』以及『C++ Primer』比較像是嚴謹的學院派大師講課,三言兩語把很多重要的觀念講得很清楚。

Thinking 系列沒啥學院風格,反而像是一個身經百戰的老兵現身說法,把軟體開發過程中常遇到的種種問題提出來討論,然後引入 OOP 的概念,說明物件導向如何幫助我們處理這些問題。

很多人學 C++ 不明究理,class 切來切去,繼承來繼承去,搞到最後自己也不知道在做什麼,最後得出一個結論:『C++ 很討厭,太複雜了,不如直接用 C 來的單純』。如果是這樣,來讀 Thinking 系列吧,作者會很巧妙的告訴你為何會有這些複雜的東西,而這些東西又怎麼來幫我們解決程式開發上的問題。


All programming languages provide abstractions. It can be argued that the complexity of the problems you’re able to solve is directly related to the kind and quality of abstraction.

The programmer must establish the association between the machine model (in the “solution space,” which is the place where you’re modeling that problem, such as a computer) and the model of the problem that is actually being solved (in the “problem space,” which is the place where the problem exists).

Thus, OOP allows you to describe the problem in terms of the problem, rather than in terms of the computer where the solution will run. There’s still a connection back to the computer: each object looks quite a bit like a little computer—it has a state, and it has operations that you can ask it to perform.


不使用 Java 的人可以直接看 Thinking in C++。

倒是 Java 系列因為會拿來跟 C++ 作比較,所以會看到很多 Java 跟 C++ 在設計上的不同處。雖然這是老掉牙的比較了,但透過 Bruce 來講這些差異,絕對跟一般我們會看到的大眾觀點,有很顯著的不同,而且是會讓人豁然開朗的那一種。

沒有留言:

lec-1 (2022-05-12) Accelerating deep learning computation & strategies

雖然用 DNN train/predict model 也好一陣子了,但這週才是第一次搞懂 cuDNN 是作什麼的 以前好奇過 tensorflow/pytorch 是怎麼做 convolution 的,FFT 不是比較好嗎? 下面的 reference 就給了很好的解釋: Wh...