Skip to content

.NET codebase should always explicitly list access modifiers. #217

Closed

Description

@mpiroc

In .NET, if a symbol has no explicit access modifiers, it defaults to the most private allows for that symbol (internal for namespace members, private for everything else). We currently rely on this behavior and omit access modifiers wherever possible.

However, we are switching to the .NET Core Coding Style Guide for .NET style. The guide specifies:

  1. We always specify the visibility, even if it's the default (e.g. private string _foo not string _foo). Visibility should be the first modifier (e.g. public abstract not abstract public).

Activity

  1. added
    style
    on Sep 7, 2018
  2. added
    language/dotnet
    on Oct 24, 2018
  3. added and removed on Apr 2, 2019
  4. added this to the milestone on Jul 30, 2019
  5. fulghum commented on Aug 13, 2019

    @fulghum

    @assyadh – any chance this changed in the new generator code?

  6. assyadh commented on Aug 13, 2019

    @assyadh
    Contributor

    Yes, the access modifiers are always there. Nothing is inferred in the new generator.

  7. assyadh commented on Aug 13, 2019

    @assyadh
    Contributor

    Closing this as this is no longer an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    language/dotnetp1style

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions