I get the warning as below screenshot and I don't understand why it would be treated like that. I often need to "regionize" my codes.
What do you think?
I get the warning as below screenshot and I don't understand why it would be treated like that. I often need to "regionize" my codes.
What do you think?
While it is true that this StyleCop rule is just a recommendation, I would not disable it though. More often than not, these #region blocks are used as a visual and reading aid. It is usually a sign that a certain function or subroutine is too long and/or composed of multiple parts. You can use this as a guide or trigger to refactor that very long code.
The default StyleCop rules are not set in stone.
I don't remember the link anymore, but someone from the StyleCop team once said that the default rules are just suggestions.
So feel free to disable rule SA1123 if you don't like it.