I really appreciate the possibility to define regions in your code, as it improves the readability insanely.
Anyways, I'd like to have everyone using the same convention in all classes (with the predefined order of all regions) like:
Do you have any proposition how this division could look like (What regions have sense and what names should they have) and in which order should they be defined ?
Someone once said that having a convention like the one above:
- Private Fields
- Constructors
- Class Properties
- Event Handlers
- etc...
is like setting a table where all the plates are together, all the spoons are together, all the knives are together and all the forks are together.
My take on the #region
issue is to put related methods, event definitions, and properties together in one region. However, having to do this at all would indicate a code smell (either your class is too big or does too many things) but this is a good first step into refactoring it into a better class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With