You might not sign up for all of them (particularly those around classes and inheritance), but these ‘Uncle Bob’-inspired tips might help you think more about how you name things and structure your code.
This document describes rules and recommendations for developing applications and class libraries using the C# Language. The goal is to define guidelines to enforce consistent style and formatting and help developers avoid common pitfalls and mistakes. Specifically, this document covers Naming Conventions, Coding Style, Language Usage, and Object Model Design.
IEnumerable<T>
is a good fit for many scenarios, but do consider that IReadOnlyCollection<T>
might be a better fit in circumstances where the collection is always
going to be fully available in memory. Avoid passing round mutable
collection types as this can cause confusion about who owns the
collection.