Search code examples
c#.netregion

Using '#region' as a quick fix to avoid refactoring into smaller functions


I often see large functions consisting of multiple #region tags. Is #region/#endregion quickly evolving evolving as means to avoid refactoring into smaller functions?

In most of the cases code defined in #region block could be moved to a separate function. What is the original intent of #region?


Solution

  • Before partial Visual Studio used it to separate auto-generated code from user defined code.