Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.
C# Best Practices
Avoid #region in your code wherever possible
Remove unused using statements
Do not use "this" keyword
Use Resharper
Make code as readable as possible, not as short as possible
Don't use singleton. It's an anti-pattern
Use one file per class with matching name
Don't depend on external static methods and properties, inject the dependencies instead
Use parametrized sql queries
Defensive copies of objects
Parameter validation
Non-confusing, descriptiove and self-explanatory variable naming
Return interfaces instead of concrete types
Naming of the extension class
Not too many parameters on a method
No view models in services
Any() instead of Count() > 0
Do not use short variable names
Explicit implementation of multiple interfaces
No public initialization methods
- Become a Best practice hero.Help us to grow the catalogue of best practices.
Recently added best practices
Anonymous