Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ValueTuple naming conventions [closed]

Tags:

When naming a ValueTuple element, should they be capitalized or not?

(string Name, int Index) rec; 

or

(string name, int index) rec; 

EDIT:

It seems the convention is PascalCase

See: https://github.com/dotnet/runtime/issues/27939#issuecomment-531420515

EDIT 2

I chose to always use camelCase. I see 'ValueTuple' as just a bag of values used almost exclusively for returning multiple values from functions. I never use ValueTuple' as a state and always prefer records for that. .

like image 841
kofifus Avatar asked Nov 16 '18 00:11

kofifus


People also ask

What is System ValueTuple?

ValueTuple is a structure introduced in C# 7.0 which represents the value type Tuple. It is already included in . NET Framework 4.7 or higher version. It allows you to store a data set which contains multiple values that may or may not be related to each other.

What is the naming convention for constants?

Constants should be written in uppercase characters separated by underscores. Constant names may also contain digits if appropriate, but not as the first character.


1 Answers

Look at tuple as bags of variables and, as such, the convention is to use camel case.

like image 194
Paulo Morgado Avatar answered Dec 11 '22 01:12

Paulo Morgado