Is the #region directive really useful in .NET?

后端 未结 17 2066
孤城傲影
孤城傲影 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:24

    I love regions because it helps me focus on just what I am working on. I use them even if the class just has a method.

    I use code snippets with regions already pre-populated, which is less typing. I feel the class is more organized and does what Code Complete talks about make it nicer for other people to read. The compiler just ignores them, they are now to make code more readable.

提交回复
热议问题