Skip to content

Example does not adhere to "Allman" standard #42325

Closed
@kye

Description

@kye

Type of issue

Typo

Description

Style guidelines specify:

Use the "Allman" style for braces: open and closing brace its own new line. Braces line up with current indentation level.

But this example on the same page doesn't use braces.

foreach (char ch in laugh)
{
    if (ch == 'h')
        Console.Write("H");
    else
        Console.Write(ch);
}
Console.WriteLine();

Examples on the page should be consistent to avoid confusion, or guidelines should specify if the "Allman" style is optional for one-line statements.

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/fundamentals/coding-style/coding-conventions.md

Document Version Independent Id

f940f2ad-e13d-4d37-6439-f8afcbc4e4c7

Article author

@BillWagner

Metadata

  • ID: 40f42506-f4a5-859a-0266-ded002056d83
  • Service: dotnet-csharp
  • Sub-service: fundamentals

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnet-csharp/svcfundamentals/subsvchelp wantedGood for community contributors to help [up-for-grabs]in-prThis issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions