Docs: Uppercase or lowercase for Tuple property names?

Created on 14 May 2019  Â·  9Comments  Â·  Source: dotnet/docs

What is the convention for naming tuple properties?

(string Person, int Age)

or

(string person, int age)

Document Details

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

Area - C# Guide Technology - C# Fundamentals P2 doc-enhancement up-for-grabs

Most helpful comment

The decision that we landed on is indeed PascalCase.

All 9 comments

That's a good question @weitzhandler

I don't know that we've addressed his in our own codebases. @jaredpar Is there an accepted practice for tuple member names and casing?

@terrajobst is driving the decision here. Not sure it's final final but the outcome is going to be that tuple names should be cased the same way you case property names.

Thanks @jaredpar

tuple names should be cased the same way you case property names.

@terrajobst If you're comfortably with that guidance, I'll add this issue to our "up for grabs" queue for community contributions.

tuple names should be cased the same way you case property names

I'd vote for that to. Public members should be pascal cased. Would be nice to update this too.

Thanks folks. I've added this to the backlog, and added the "up for grabs" label.

Actually not that simple.
Local variables might have different behavior. If you're going to make an official documentation about it, it should have clear rules.

For instance:

```c#
int x = 5, y = 10;

var t = (x, y);

x = t.x;
y = t.y;
```

The decision that we landed on is indeed PascalCase.

@BillWagner I went through the referenced doc and it appears all of the associated samples are in line with this naming convention guidance as far as I can tell.

Is there anywhere explicitly that you'd like this guidance added additionally? If not, this can likely be closed at this point.

Thanks @SeanKilleen

I'll close this.

Is there anywhere explicitly that you'd like this guidance added additionally? If not, this can likely be closed at this point.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LJ9999 picture LJ9999  Â·  3Comments

sebagomez picture sebagomez  Â·  3Comments

gmatv picture gmatv  Â·  3Comments

garfbradaz picture garfbradaz  Â·  3Comments

svick picture svick  Â·  3Comments