2011年3月23日 星期三

Smell good? [釋疑篇]

Compose Method [Beck, SBPP]

You can't rapidly understand a method's logic.

Transform the logic into a small number of intention-revealing steps at the same level of detail

以下 by [Kerievsky, Refactoring to Patterns]

Motivation:
這個 pattern 看起來很簡單, 好像每個 programmer 都應該這樣寫 code, 但是如果你仔細檢視一下自己寫的 code, 你會發現, 應該大部份的 code 都沒有做到這個 pattern 的要求. Compose Method 簡單來說, 就是 method 裡面 compose 其他的東西, 都必須要在同個 detail 等級之下(Mechanics 第五點).

2011年3月20日 星期日

Smell good?

最近為了國人的生活品質與身體健康, 義無返顧的投入了清潔大隊, 在經歷了尖山火池, 天崩地裂, 毒氣瀰漫, 輻射籠罩的考驗中, 能活著回來真的是菩薩保佑, 祖上積福~ 在身體還未被恐怖的碘, 鈽的放射性同位素給侵蝕殆盡前, 趕快將所見所聞來跟大家分享~

在此先端出德高望重的貝克大師[Beck Kent]的武林秘笈心法:

扛布絲埋圾袋 [Compose Method]