Is the #region directive really useful in .NET?

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

    Going on with what has been previously said by Russell Myers, if you learn how to refactor your code properly (a skill proficient developers must learn), there really isn't too much of a need for regions.

    A couple of weeks ago I thought regions were great because they allowed me to hide my fat code, but after exercising my code skills I was able to make it slimmer and now I fit into a size 7 class (someone should SO make that a measurement for refactoring in the future! :P)

提交回复
热议问题