前幾日經 RSS 睇到個 post 講 maintainable, 睇完都有同感.
Maintainable is a value that can only be applied by someone who is familiar with the codebase. If that someone find it hard to work on the codebase, it is hard to maintain. If someone with no knowledge of a codebase find it hard to work with it, tough luck, but that doesn’t say anything about the maintainability of a code base.
A codebase is more than just a code sample, it is conventions, ways of doing things, overall architecture and a sense of how to do things.
Now, there is a separate value, related to how easy it is to bring someone up to speed on the codebase, but that does not relate directly to maintainability.
公司唔係 Software House, 有好多古舊既 code 都係無乜被設計過, 見到有好多 On Demand 加上去既 Feature, 同埋一大堆不段累積既雜 code, 經過很多不同 developer 世代經手後, 形成了 Anti-Pattern 中既 Lava flow.
公司既舊 code, 最難 maintenance 既話分係 multi-programming language, 可能因為 application-database 既關係, 老一輩寫開既大多都係 stored procedure, 除左 data filtering 之外, 很多簡單既 business logic 都 embed 左係入面, 就連 SELECT * FROM tblA 都會寫入 stored procedure, 除此之外, 舊 code 除左 C#, 仲有 Visual Basic, C++, J2ME, PHP, ASP.net 等等, 好難去用同一個 IDE 黎睇晒同一個 project 既野, 所以 maintainability 都幾困難. 不過, 近期新人多左, 公司都慢慢有了改變, 除左要些時間磨合之外, 公司都開始進步, 不似之前有點停滯不前既感覺.
軟件, 寫下來就要不段地維護及更新, 世界在變, 如果軟件不變, 那就會變得不合時宜, 所以維護性係一個十分重要既部份!!