I'm CaLendarW Blog

8 ways to be a better programmer in 6 minutes.

by calendarw on May.18, 2009, under diary, soft skill

前日子維 send 左個 post 比我, 內容幾好, 都係講緊 software improvement – 8 ways to be a better programmer in 6 minutes

1. 用大 Size 既字
當用左大 Size 既字後, 因為睇既野少左, 所以你就要開始諗點寫短一些既 method, 從而減低軟件既複雜性及增加可讀性

2. 將 hard code 既 string 變得討厭
這樣可以鼓勵你寫少一點 hard coding, 同埋指示你那裡有 hard coding

fonts & color

Visual Studio Options

3. 學習一下關鍵字 (keyword)
每隻 language 既關鍵字都有佢既用途, 請認識一下 language 不同關鍵字既用處. 以我為例, 呢兩年都開始學多左用不同既關鍵字, 例如 (is, as, ?? opertor 等), 識多一點更會簡化自己既 coding, 亦對自己既寫作有幫助.

以下係原文提供既幾個 .net languages 參考: C#, VB.net, F#.

4. 增加 1% 代碼覆蓋度
除左用自動化單完測試外, 進一步測驗一些內容深入難明或易錯既地方. 增加 1% 覆蓋度對代碼更有幫助

5. 閱讀 Open Source Project
學習一下 Open Source 既代碼, 對自己會有幫助. 近年都開始睇緊 NHibernate, Rhino-Tools 等既 Source Code, 當然係有些難度, 不過真係 improve 到好多方面既 skill, 例如學下人地 d Test Case 點寫, Inheritance 既 Test Case 點寫, 人地用咩 keyword 去處理事件, 同埋人地點設計等等.

亦可以參考原文建議既 Hanselman’s Weekly Source Code series.

6. 用代碼分析軟件進行分析
這個可減少代碼既複雜性.
原文有幾個 Tools:  fxcop, StyleCop, clone detective, ndepend, 或者 code metrics feature of VS 2008

7. 找一個最醜既 method 進行重構
重構一個不唔清晰既 method 可以提升到軟件既架構, 可讀性, 重用性等多個方面

8. Stop Reading, Start Writing
學以致用才是最好既學習模式, 最好由最基本既寫起, 原文建議寫 Complier. 另一方面, 我見過既好多人都有個好重要既問題, 就係佢地從來都無 Start Reading, 有些連學校教既野都唔會去用, 寫出黎既野完全難以重用!! 請記住, 係 Stop Reading 之前係有個 Start Reading 的, 如果你無一個清楚既概念, 無 Start Reading 既話, 就好難會學得好!!

:,

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!