Contents
Chapter 1 C# Language Elements
Item 1: Always Use Properties Instead of Accessible Data Members
Item 2: Prefer readonly
to const
Item 3: Prefer the is
or as
Operators to Casts
Item 4: Use Conditional Attributes Instead of #if
Item 5: Always Provide ToString()
Item 6: Distinguish Between Value Types and Reference Types
Item 7: Prefer Immutable Atomic Value Types
Item 8: Ensure That 0
Is a Valid State for Value Types
Item 10: Understand the Pitfalls of GetHashCode()
Chapter 2 .NET Resource Management
Item 12: Prefer Variable Initializers to Assignment Statements
Get Effective C#: 50 Specific Ways to Improve Your C# 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.