發表文章

目前顯示的是 4月, 2013的文章

Dynamic typing的一種哲學

我在意的不是這個物件的型別,而是我能對這個物件做什麼。 這是最常見的動態型別語言中的設計思維,也是最近很流行的各種dynamic typing的語言很重要的觀念。 最有名的duck typing: If it walks like a duck and talks like a duck, it may as well be a duck. 我有好一陣子很不喜歡動態型別的語言,大概因為我第一個接觸的語言是C,有嚴格且複雜又容易出錯的型別問題,所以寫程式把每個物件的型別宣告的清清楚楚,無論是早期的Java或C#,是我比較喜歡的語言。 但是受Ruby, Python甚至是突然找到第二春的JavaScript影響,Java和C#都紛紛引進dynamic typing的機制,並且很多強者都推薦,如果是local variable,盡量用dynamic typing,可以加快開發速度,並且把型別的轉換丟到runtime時讓平台本身決定,省去很多麻煩的型別轉換問題,和可能會轉換失敗的exception。 有道理。

Pale moon

圖片
Pale Moon 是以Firefox為基礎改的browser, 簡單說,他是最佳化的Firefox瀏覽器,有x86、x64的版本,執行的速度跟效能都相當不錯。(雖然Chrome很火,但是因為太火我不喜歡,還是當一下Firefox的用戶替他增加那一點點的佔有率 XD) 這是有關Pale  Moon在Wiki上的介紹 Pale Moon is a web browser based on Mozilla Firefox. It is available for Windows platforms and distributed by M.C. Straver. Pale Moon builds on Firefox, optimizing for efficiency of code and aimed at current and modern microprocessors. Pale Moon is available free of charge as open source code archive and freeware binary releases. Most of the available Firefox extensions and plugins are compatible with Pale Moon.  Screenshot: