Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is using non standard English characters in c# names a bad practice? [closed]

Tags:

c#

English is not my native language. I would like to use non-English characters in my code, for instance: "ç, ã, é ..."

Is it a bad practice to use those characters for classes, variable or method declarations?

I'm not asking what characters are technically available in c#, My question is whether or not it is a good idea.

like image 527
Daniel Santos Avatar asked Aug 16 '16 23:08

Daniel Santos


2 Answers

There's no technical issues with using non-English characters. C# allows a very large number of Unicode symbols in variable names. The real question is whether or not it is a good idea.

To answer that, you really have to ask yourself a question of "who is my audience?" If your code will only be looked at by French speakers typing on a French layout keyboard, ç is probably a very valid character. However, if you intend your code to be modified by others whose keyboard layout is not French, you may find that that symbol is very hard for them to type. This will mean that, if they want to use your variable name, they'll have to cut/paste it in place because they can't type it directly. This would be a death sentence for any development.

So figure out who your audience is, and limit yourself to their keyboard layout.

like image 144
Cort Ammon Avatar answered Nov 14 '22 21:11

Cort Ammon


It's supported. See here: http://rosettacode.org/wiki/Unicode_variable_names#C.23

Whether it's bad practice or not, it's hard to tell. If it works, it works. Personally, I'd just choose a language all the possible contributors understand.

like image 5
HaukurHaf Avatar answered Nov 14 '22 22:11

HaukurHaf