l

2010年5月18日 星期二

從 The Timeless Way of Building 學設計 (3)

05/17 23:19 ~ 05/18 00:14

沒時間了,廢話不多說,翻到課本第 24 章:The Process of Repair

Next, several acts of building, each one done to repair and magnify the product of the previous acts, will slowly generate a larger and more complex whole than any single act can generate.

上面這一句先讀一次,看不懂最後回頭再看一次。

No building is ever perfect.

Each building, when it is first built, is an attempt to make a self-maintaining whole configuration.

But our predictions are invariably wrong. People use buildings differently from the way they thought they would. And the larger the pieces become, the more serious this is.

把上面這三句裡面的 building 用 software 替換,people 用 customers,clients 或是 users 替換,是不是也完全講的通?這一段的重點還沒完,繼續往下讀。

The process of design, in the mind's eye, or on the site, is an attempt to simulate in advance, the feeling and event which will emerge in the real building, and to crate a configuration which is in repose with respect to these events.

But the prediction is all guesswork; the real events which happen there are always at least slightly different; and the larger the building is, the more likely the guesses are to be inaccurate.

It is therefore necessary to keep changing the buildings, according to the real events which actually happen there.

And the larger the complex of buildings, neighborhood, or town, the more essential it is for it to be build up gradually, from thousands of acts, self-correcting acts, each on improving and repairing the acts of the others.

看完上面這幾句,鄉民們應該有聞到『iterative and incremental development』和『refactoring』的味道吧(鄉民甲:我鼻子不通,沒聞到...)。傳統 waterfall 開發流程強調 big up-front design,希望藉此讓之後的實做變得很順利。因此也就造成有人認為軟開發只要經過架構師與分析師分析設計好之後就可以把設計文件丟給 programmers,然後把 programmers 當成生產線工人一樣『操』,之後系統就自然而言生出來啦。看官們,有可能嗎?看看第三句就知道了 (But our predictions are invariably wrong...)。

Alexander 認為建築物不是設計好,蓋好就沒事了,還需要依據實際使用的狀況去改善與修復。這個精神和 agile methods 所談的避免 big up-front design 改採用 evolutionary design,並且頻繁地套用 refactoring 來增進現有系統的品質是相似的(Teddy 不敢說完全一樣啦...)。這個也和 David Thomas 在 http://www.artima.com/intv/dry.html 所提到的:

All programming is maintenance programming

的精神很類似。Programmers 其實隨時隨地都處在『維護模式』,因為很少真正的開發活動是『全新的』。就算是開發一個新的 story,也都是這邊寫一寫,那邊改一改,總是多多少少會和已存在的程式碼打交道。如果抱持著 all programming is maintenance programming 的心態,看到設計不良的地方,隨手做 refactoring,則系統的品質便可逐漸改善,這也使得未來增加新的功能變得更容易。但是如果沒有這種『時時勤拂拭,勿使惹塵埃』的精神(很遺憾,很多人都沒有...),認為『幹嘛改,程式可以動就好了啊』,那麼軟體便逐漸朝向『比硬體還要硬的硬體』邁進(這是什麼東東?)。


***

友藏內心獨白:救命啊,這一系列快掰不下去了啦。

2 則留言:

  1. Teddy學長的這一系列要到上百回,根本不是問題啦 XD

    回覆刪除
  2. To zwshen:

    不用你寫你當然那麼說啊(指導教授:寫 10 篇 SCI papers 才可以畢業)... 不然你來接力好了 ^o^

    回覆刪除