3 ms·
There are countless examples of where allowing non-ASCII identifiers makes code more readable in non-English languages. For example a Brazilian coder might writ
by jl6 12y ago
There are countless examples of where allowing non-ASCII identifiers makes code more readable in non-English languages. For example a Brazilian coder might write
país = "Brasil"
Without the accent, pais means fathers rather than country.
Imagine how constraining it would be to code in a language that disallowed vowels in identifiers (perhaps because it had been designed by Hebrew speakers). That's how most of the world experiences Python 2.
- icebraining 12y agoAs a Portuguese coder myself, I shudder seeing that code. You know how would that be written at my company? country = "Brasil" Code in languages other than English is just painful.
- gone35 12y agoSure: your point feels right logically and politically, but in fact it doesn't quite work that way: for Latin script-based languages like Portuguese, non-ASCII letters are extensions (diacritics or liaisons) of the basic Latin alphabet that are often left out in informal writing (eg by grade students, when texting/chatting, or by "uneducated" speakers) when the context is clear and a romanized phonetic approximation is available. As a result, native speakers are well used to homonymy in daily use, even though it might appear quite confusing to a non-native. So, in practice, ambiguities like the one you point out are more likely than not to be as constraining to Latin script-based programmers as common English homographs like "bank" do.