Using #region/#endregion for code appearance. Is there anything wrong with this?

Hi, so I saw a piece of code the other day and I thought it was interesting how he was using #regions. It looked like this.

 #region Properties #region Description /// <summary> /// Description of the xml pattern. /// </summary> public string Description { get; internal set; } #endregion #region TextPattern /// <summary> /// The text-format pattern. /// </summary> public string TextPattern { get; internal set; } #endregion #region Modifer /// <summary> /// The modifer to add to the result. Default is 0. /// </summary> public int Modifer { get; internal set; } #endregion #region PatternResultMode /// <summary> /// The pattern <see cref="Internals.PatternResultMode"/>. /// </summary> public string PatternResultMode { get; internal set; } #endregion #endregion 

The reason I thought it was cool, is because the only other way I see is just simply blank space between where the #region's are used in that example. This means it's using the same exact amount of lines as if you put a space between it, but adding a bit of readability/option to drop stuff down if you wanted.

Is there anything wrong with using that style? I kind of like it.

by JacobKemple via /r/csharp

Leave a Reply