dennisdoomen / CSharpGuidelines

A set of coding guidelines for C# 9.0, design principles and layout rules for improving the overall quality of your code development.
https://www.csharpcodingguidelines.com
Other
745 stars 272 forks source link

Revisit: Casing for tuple elements #139

Closed bkoelman closed 6 years ago

bkoelman commented 6 years ago

Follow-up on https://github.com/dennisdoomen/CSharpGuidelines/issues/107 and https://github.com/dennisdoomen/CSharpGuidelines/issues/104#issuecomment-359691376, based on this article. After reading the article, I agree it would be better to distinguish between tuple element names and variables declared using tuple syntax.

So I propose to update the casing table in AV1702 like this:

  1. Remove row "Tuple element"
  2. Add row "Tuple element names" Casing: Pascal Examples: (string First, string Last) name = ("John", "Doe"); var name = (First: "John", Last: "Doe"); (string First, string Last) GetName() => ("John", "Doe");
  3. Add row "Variables declared using tuple syntax": Casing: Camel Examples: (string first, string last) = ("John", "Doe"); var (first, last) = ("John", "Doe");