Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-360

Proposal: replace #region directives with comments

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.4
    • 1.3.1
    • None
    • None

    Description

      The code base currently uses #region directives (as recommended by Microsoft) to mark regions of the file (constructors, properties, methods, etc...).

      The disadvantage of using #region directives is that when you open a file in Visual Studio the regions are collapsed (when using default Visual Studio settings). This is annoying, because one must immediately expand all the regions to look at or work on the file.

      The proposal is to replace:

      #region some comment
      ... contents of the region
      #endregion

      with

      // some comment
      ... contents of the region

      The files would still be organized like they are now (grouping similar members like properties or methods together) but just wouldn't have #regions anymore.

      The only thing lost is the ability to collapse regions, but I personally never find collapsing the regions helpful.

      See the related JIRA issue about code formatting as well.

      No decision will be made on this proposal for a few weeks to allow time for comments.

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            robert@mongodb.com Robert Stam
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: