Daniel Santos Daniel Santos - 2 months ago 5x
C# Question

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

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

Is a bad practice using those characters for classes, variable or methods declarations?

I'm not asking what characters are technically avaliable 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.