CSharpHandbook
CSharpHandbook copied to clipboard
The focus of this document is on providing a reference for writing C#. It includes naming, structural and formatting conventions as well as best practices for writing clean, safe and maintainable code...
C# offers support for object-initialization, including init and required properties that allow a user to create immutable objects with a very convenient syntax. Avoid using factories to create objects that...
## Notes A `struct record` has mutable properties, whereas a `record` has immutable properties. A `readonly struct record` has immutable properties. Be aware that simply changing `record` to `struct record`...
See [Custom Parameterless Struct Constructors](https://benbowen.blog/post/two_decades_of_csharp_vi/) for more information and examples.
## Notes It's fine to use them, of course. Just be aware that the lifetime of each using is the entire method. If you stick to shorter methods without or...
## Notes Library authors should be aware that package users will generally only see the source files downloaded via SourceLink. If too many of the usings are in a solution-specific...
## Observed The document is quite long and doesn't provide very much of a summary of the rules most important to developers. ## Expected The document should include an FAQ...
Every code-coverage tool I've seen tracks coverage by lines. A ternary operator or coalescing operator places multiple branches on a single line. For example, the following code looks quite verbose....
Relevant for the manual - Nullable reference types (default settings, how to use) - Default implementations (rework the extension methods section/advice) - Target-typed new expressions - Switch expressions (lightweight pattern-matching)...
Hello, We have been using the handbook quite a bit. but have not been able to find the settings files. > Settings files > This repository includes configuration files that...