8000 Naming conventions for private constants · Issue #46866 · dotnet/docs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Naming conventions for private constants #46866
Open
@musjj

Description

@musjj

Describe the issue or suggestion

Identifier names - rules and conventions page specifies that:

  • Use PascalCase for constant names, both fields and local constants.
  • Private instance fields start with an underscore (_) and the remaining text is camelCased.

And the .NET Runtime team's coding style also specifies that:

We use _camelCase for internal and private fields
We use PascalCasing to name all our constant local variables and fields.

But it doesn't clarify whether private constants should be _camelCase or PascalCase.

The const keyword page implies that it should always be PascalCase. But it also illustrates some odd naming conventions, such as public fields called x and y (shouldn't it be X and Y?).

I think an explicit clarification would be helpful here.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0