Closed Firemanarg closed 1 year ago
I agree and I think "char" is better. In programming languages like C# or Typescript when defining a character is char x = ect... So we should pick that one. Also consider that "chr" or "char" are not that different so using "char" is not such a big deal.
I've also seen ch
in code. This is also part of the famous getch()
.
But using 'char' in some languages is a reserved word. In C or C++ for example, you just can't declare a char variable called 'char', because it is a type name.
I've also seen ch in code. This is also part of the famous getch().
I think the naming in C is not that consistent. getch
is a good example:
char x = getch();
What was the intention in C to abbreviate character
? char
or ch
?
IMO ch
is too short and it could mean channel
too. E.g. if I saw a variable like ch_index
I could assume channel_index
or character_index
too.
But using 'char' in some languages is a reserved word. In C or C++ for example, you just can't declare a char variable called 'char', because it is a type name.
But you can use it in function names, like: find_char
.
@kisvegabor: You're onto something. Reading your variable name examples, I also think the part ch
would rather be pronounced as the beginning of "channel" and not as the first sound of "character". So, in this sense, having it abbreviating "character" is less intuitive. However, having a solution for the problem where you would like to name a variable char
, but can't, would still be desirable. Instead of naming a variable string
, you can name it text
; but that's about multiple characters in one variable.
BTW, "chan" in "4chan" means "channel", so there's another abbreviation for "channel".
However, having a solution for the problem where you would like to name a variable char, but can't, would still be desirable. Instead of naming a variable string, you can name it text; but that's about multiple characters in one variable.
char
is not working only if you use as it is. E.g. char_index
or last_char
is fine. As the name char
on it's own could mean a lot of things it's unlikely that it will be used in a larger context (e.g. as a global variable name). In smaller contexts (e.g. in an if
) I usually use c
. Probably it lives only in a few lines so it's easy to remember what it is.
BTW, "chan" in "4chan" means "channel", so there's another abbreviation for "channel".
IMO chan
doesn't make channel
that much shorter. On instruments I usually see ch1
, ch2
, etc.
So it's better using 'char' for character and 'ch' for channel.
I've checked and after this discussion I think we have to change the channel circle to green because right now is yellow.
I've checked and after this discussion I think we have to change the channel circle to green because right now is yellow.
I agree.
"So it's better using 'char' for character and 'ch' for channel." I also agree
I close this PR. Thank you for the contribution.
Ups, I forgot to click the Close button. :slightly_smiling_face:
I think we should pick either
chr
orchar
to have a clear recommendation forcharacter
.@philipeachille @T1xx1
What do you think?