顯示具有 development 標籤的文章。 顯示所有文章
顯示具有 development 標籤的文章。 顯示所有文章

星期六, 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 來講這些差異,絕對跟一般我們會看到的大眾觀點,有很顯著的不同,而且是會讓人豁然開朗的那一種。

星期五, 7月 03, 2009

Code Monkey

Code Monkey 指的是『靠寫程式維生的人』,大陸翻譯成『代碼民工』(也許應該叫『編程民工』才比較對)。
光看解釋聽起來還好,大家不都是靠某些技能維生嗎?但可不要隨便用來形容別人,因為這是略帶侮辱意涵的用語。



對某些程式員來說,每天的工作就是『磨』出程式碼來,而不會去分析既有的程式,思考更深一層的程式架構與設計方面的問題。就好比把石磨跟黃豆丟給一隻猴子,再怎麼樣猴子也能磨出些什麼東西來。但猴子卻不知道牠到底在做什麼,只知道牠這樣攪和幾下就可以有香蕉吃。

如果一個程式員只是每天在鍵盤上敲敲打打,弄出些程式碼來,那找一隻猴子來也能作差不多的事。

仔細想想就覺得發明這個名詞的人還蠻毒舌的。



另外一類是屬於自我貶抑的用法。例如在某些龐大組織架構下,底層的工程師離決策層太遠,沒有說話的份量,只能完全聽從指示工作。在這樣的組織裡,有如養了一批會寫程式的猴子。所以有人會這樣說:『別問我為什麼要這樣那樣,我不過是隻 code monkey』。

Code monkey 也可以用來形容自己的才能被嚴重低估。有些程式員每天得負責『噴』出大量的程式碼來,而寫的都是些簡單、固定而且毫無趣味的程式。『我的工作連隻猴子也能作』—他們覺得作這樣的工作真是太委屈自己了。

Are you a code monkey? Don't be a code monkey.



Code Monkey get up get coffee
Code Monkey go to job
Code Monkey have boring meeting with boring manager Rob
Rob say Code Monkey very diligent
but his output stink
his code not functional or elegant
what do Code Monkey think
Code Monkey think maybe manager want to write goddamn login page himself
Code Monkey not say it out loud
Code Monkey not crazy just proud

Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
with big warm fuzzy secret heart
Code Monkey like you
Code Monkey like you

Code Monkey hang around at front desk
tell you sweater look nice
Code Monkey offer buy you soda
bring you cup bring you ice
you say no thank you for the soda cause
soda make you fat
anyway you busy with the telephone
no time for chat

Code Monkey have long walk back to cubicle
he sit down pretend to work
Code Monkey not thinking so straight
Code Monkey not feeling so great

Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
with big warm fuzzy secret heart
Code Monkey like you
Code Monkey like you a lot

Code Monkey have every reason
to get out this place
Code Monkey just keep on working
to see your soft pretty face
Much rather wake up eat a coffee cake
Take bath, take nap
This job fulfilling in creative way
such a load of crap
Code Monkey think someday he have everything even pretty girl like you
Code Monkey just waiting for now
Code Monkey say someday, somehow

Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
with big warm fuzzy secret heart
Code Monkey like you
Code Monkey like you

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

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