Is the #region directive really useful in .NET?

后端 未结 17 1917
孤城傲影
孤城傲影 2021-01-03 23:43

After maintaining lots of code littered with #region (in both C# and VB.NET), it seems to me that this construct is just a bunch of \"make work\" for the programmer. It\'s w

17条回答
  •  星月不相逢
    2021-01-04 00:09

    There really isn't a benefit. They are a code smell. After using them for awhile, I got sick of them. If you need to break things out by functionality, use a partial class.

提交回复
热议问题