Contents
Chapter 1 Working with Data Types
Item 1: Use Properties Instead of Accessible Data Members
Item 2: Prefer Implicit Properties for Mutable Data
Item 3: Prefer Immutability for Value Types
Item 4: Distinguish Between Value Types and Reference Types
Item 5: Ensure That 0 Is a Valid State for Value Types
Item 6: Ensure That Properties Behave Like Data
Item 7: Limit Type Scope by Using Tuples
Item 8: Define Local Functions on Anonymous Types
Item 9: Understand the Relationships Among the Many Different Concepts of Equality
Item 10: Understand the Pitfalls of GetHashCode()
Item 11: Avoid Conversion Operators in Your APIs
Item 12: Use Optional Parameters to Minimize Method Overloads
Get More Effective C# (Includes Content Update Program): 50 Specific Ways to Improve Your C#, 2nd edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.