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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With