- Clean Code in C#
- Jason Alls
- 215字
- 2021-06-18 18:28:11
Summary
In this chapter, we learned about organizing our namespaces in folders and packages, and how good organization can help to prevent namespace classes. We then moved on to classes and responsibility and looked at why classes should only have one responsibility. We also looked at cohesion and coupling and why it is important to have high cohesion and low coupling.
Good documentation requires public members to be correctly commented on in documentation tools, and we saw how to do this using XML comments. The importance of why you should design for change was also discussed with basic examples of DI and IoC.
The Law of Demeter showed you how to not to talk to strangers, but only immediate friends, and how to avoid chaining. And finally, we looked at objects and data structures and what they should hide and what they should make public.
In the next chapter, we will briefly cover functional programming in C# and how to write clean methods that are small. We will also learn to avoid having more than two parameters in our methods, as methods with many parameters can become unwieldy. Plus we will learn to avoid duplication which can be a troublesome source of bugs when fixed in one location, but still exist elsewhere in your code.
- 從零開始:數字圖像處理的編程基礎與應用
- Python Deep Learning
- CouchDB and PHP Web Development Beginner’s Guide
- Troubleshooting PostgreSQL
- PhoneGap:Beginner's Guide(Third Edition)
- Python函數式編程(第2版)
- 從零開始學Android開發
- 嵌入式Linux C語言程序設計基礎教程
- Sitecore Cookbook for Developers
- Offer來了:Java面試核心知識點精講(框架篇)
- Raspberry Pi Robotic Projects
- Daniel Arbuckle's Mastering Python
- 數據預處理從入門到實戰:基于SQL、R、Python
- ASP.NET程序開發參考手冊
- Java程序設計項目教程(第二版)