Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:59:55+00:00 2026-05-24T19:59:55+00:00

I recently inherited some C# code where nearly every item in a file was

  • 0

I recently inherited some C# code where nearly every item in a file was wrapped in an individual #region/#endregion block — every class, every function, every property, every enum, but not the fields. Each of these was in turn wrapped in a “grouping” #region (e.g. “Properties”, “Constructor”, “Methods”, etc.). There are multiple overloads of a single function with different argument lists, but they’re each wrapped in individual regions with the same name, rather than a single region for all three overloads. The person who wrote this code is no longer with the company, and from the history in source control, it appears that these were present in the initial submission, and the practice continues through successive versions of the code as new properties and methods are added.

Any idea why this might be done? Some thoughts:

  1. An overzealous VS feature (or code-cleanup tool) automatically inserted the #region/#endregion blocks, and the author didn’t remove them.
  2. There’s an IDE that folds regions but not functions, so this was necessary to get syntax folding.
  3. This is a method of stubbing out the structure of your code prior to implementing it.

EDIT: I chose Jonathan’s answer because it contributed a new reason why someone might have chosen to do this. Thanks for the discussion!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:59:56+00:00Added an answer on May 24, 2026 at 7:59 pm

    When it comes to non-auto-implemented properties it can make the code easier to navigate. For instance a lot of the following code (inside the region) is just extraenuous fluff – which always looks the same (as properties really shouldn’t have side-effects). Having a single line saying “Property – Name” is much nicer to navigate.

    #region Property - Name
    private string _name;
    /// <summary>
    /// Gets or sets the name of the customer.
    /// </summary>
    /// <remarks>
    /// This should always be the full name of the customer in the format {First Name} {Last Name}.
    /// </remarks>
    /// <example>
    /// customer.Name = "Joe Bloggs";
    /// </example>
    /// <seealso cref="Customer"/>
    /// <value>
    /// The name of the customer.
    /// </value>
    public string Name
    {
        get
        {
            return _name;
        }
        set
        {
            _name = value;
        }
    }
    #endregion
    

    However, as far as the ‘member type’ (Methods, Properties, Constructors, Fields) go I feel it makes the code harder to navigate; however other people feel it makes it easier.

    In the end it’s a coding standard and religous. If you don’t like it, don’t use it one your personal projects. If you are required to use it due to a standard then use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m looking for some advice. I recently wrapped up a project where I inherited
I recently inherited a small Java program that takes information from a large database,
I recently inherited a database on which one of the tables has the primary
I recently inherited a VBA macro that needs to have validation logic added to
I've recently inherited an application that makes very heavy use of session, including storing
I've recently inherited a internationalized and text-heavy Struts 1.1 web application. Many of the
I've recently inherited the job of maintaining a database that wasn't designed very well
I've recently inherited a fairly large web site. The project is set up as
I have recently inherited a website written in Classic ASP, and am currently trying
My application I've recently inherited is FULL of deprecation warnings about the constructor: Date

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.