The C# language specification says we can use Unicode characters in specifiers (class and variable names, etc.)
I went a long way doing this in my code. Since I live in Brazil, this includes lots of accented characters, with variable names such as rotação
, ângulo
, máximo
, etc.
Every time a more "experienced" developers catches this, I am strongly advised to avoid it and change everything back. Otherwise a lot of kittens will die.
I went then a quite long way undoing it, but today I found some variables still named with accents, in methods written long ago, and no kitten died so far (at least not because of that).
Since my language (Portuguese) is accented, it would make a lot of sense if our codebase has those characters, since C# explicitly allows it.
Are there any sound technical reason not to use Unicode characters in C#/Visual Studio codebases?
What if you had to take over code written in Cyrillic? Most developers are comfortable with standard Latin character sets. They're easy to type on any keyboard.
I would recommend sticking to the simple set.
A few reasons why not to use Unicode variable names:
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