I Don't Say Anything to C# Regions, Actually, Because They're Inanimate ConstructsPosted: 11 years and 7 months ago
I do C# programming for my job. Yesterday, I did a search for something relating to the
#region construct, which Visual Studio uses for code-folding organization. I found this article where an emphatic programmer slammed their use and essentially publicly shamed people for using them. His is an extreme position and an extreme headline, both which garner attention (it got mine).
Extreme positions, while useful in providing a clear, unadulterated opinion, just never seem useful in the vacuum of the post, speech, or article they reside in. They can only be understood in the greater context of the idea they describe. Thus, people commenting and saying "Man, your opinion is extreme and I don't like it" or "Man, your opinion is extreme, and I like it" is also not useful to me, because it's all extreme commenting with little to no nuance.
The author later admitted to recently having a very negative experience with
#regions and that it may have influenced his extreme article. His admission is pretty predictable, as I find most extreme positions coming from an extremely one-sided environment that doesn't easily allow for opinions that differ. Basically, he had to deal with some overwhelming use of the programming construct and it screwed with his day, and then he wrote a scathing screed against them. He doesn't use
#regions and his code is brilliant, so others who "abuse" them must be wrong.
I don't believe using an IDE's organizational tool to help you code is wrong or bad. The abuse of anything is always an issue and checking yourself before you wreck yourself is always useful. In other words, an article stating that you should try not to overuse an element that can lead to difficulty in understanding something later for both you and someone else would probably be more constructive. It would also probably just be disregarded by people because it's not a strong, extreme position. It's misconstrued as flaky or wishy-washy. A headline that says "Use C# Regions Sparingly, Wisely" is not as attention-grabbing as "C# REGIONS ARE ONLY USED BY JERKS", and it never will be.
So it goes.