Building Maintainable Software, C# Edition: Ten Guidelines for Future-Proof Code (Paperback)

Joost Visser, Sylvan Rigal, Gijs Wijnholds, Pascal van Eck, Rob van der Leek

買這商品的人也買了...

相關主題

商品描述

Have you ever felt frustrated working with someone else’s code? Difficult-to-maintain source code is a big problem in software development today, leading to costly delays and defects. Be part of the solution. With this practical book, you’ll learn 10 easy-to-follow guidelines for delivering C# software that’s easy to maintain and adapt. These guidelines have been derived from analyzing hundreds of real-world systems.

Written by consultants from the Software Improvement Group (SIG), this book provides clear and concise explanations, with advice for turning the guidelines into practice. Examples for this edition are written in C#, while our companion Java book provides clear examples in that language.

  • Write short units of code: limit the length of methods and constructors
  • Write simple units of code: limit the number of branch points per method
  • Write code once, rather than risk copying buggy code
  • Keep unit interfaces small by extracting parameters into objects
  • Separate concerns to avoid building large classes
  • Couple architecture components loosely
  • Balance the number and size of top-level components in your code
  • Keep your codebase as small as possible
  • Automate tests for your codebase
  • Write clean code, avoiding "code smells" that indicate deeper problems

商品描述(中文翻譯)

你是否曾經在與他人的程式碼合作時感到沮喪?難以維護的原始碼是當今軟體開發中的一個大問題,導致延誤和缺陷的成本增加。成為解決方案的一部分。透過這本實用書,您將學習到10個易於遵循的指南,以提供易於維護和適應的C#軟體。這些指南是從分析數百個真實系統中獲得的。

本書由軟體改進集團(SIG)的顧問撰寫,提供清晰簡明的解釋,並提供將指南轉化為實踐的建議。本版本的示例是用C#編寫的,而我們的Java伴侶書則提供了該語言的清晰示例。

- 編寫短小的程式碼單元:限制方法和建構函式的長度
- 編寫簡單的程式碼單元:限制每個方法的分支點數量
- 避免複製有錯誤的程式碼,而是編寫一次
- 通過將參數提取到物件中,使單元介面保持小巧
- 分離關注點以避免建構大型類別
- 鬆散耦合架構組件
- 在程式碼中平衡頂層組件的數量和大小
- 保持程式碼庫盡可能小
- 自動化程式碼庫的測試
- 編寫乾淨的程式碼,避免顯示更深層次問題的「程式碼異味」