|
|
|
|
|
by SwiftyBug
228 days ago
|
|
I'm a native Portuguese speaker. Here, when people are first starting to learn programming, it's very common for them to write code in Portuguese. For example, they would write this simple age verification algorithm: int verifica_idade(int idade) {
if (idade < 18) { return -1; }
return 1;
}
int main() {
int idade;
scanf("%d", &idade);
int verificacao = verifica_idade(idade);
if (verificacao < 0) { printf("Acesso negado\n"); }
else { printf("Acesso liberado\n"); }
return 0;
}
Do French (or other languages) speakers also do this? |
|
I don't know anything about the Portuguese script. But your example seems to be made entirely of regular Latin alphabets. Now imagine another language where that isn't the case. Just switching the layout even on a programmable keyboard is going to be a major annoyance. I can touch type on two layouts (English Qwerty and Malayalam Poorna Inscript, in case you're wondering). Occasionally switching between the two layouts is the biggest distraction while typing prose - even with convenient layer switchers programmed in. Programming is going to be hell if the keywords and identifiers are in different scripts. I reckon that it would slow me down to about one-third of my full speed.
There are genuine reasons why identifiers could be in another language - like programming for linguistics (spelling and grammar checkers, morphology analyzers, etc) or while dealing with regional concepts. But even in those cases, programmers simply transliterate it into Latin script, rather than use the original script. Their sound roughly the same. But full fidelity is not possible (there are sounds that you may not have even imagined before). Even so, it's easier to just compromise on fidelity rather than do constant layout switching.
And then there is the reality that many language scripts are simply unusable for programming. My own language is agglutinative - meaning that multiple words fuse into one (even 4 words combining is not unusual). The same thing can be written in a dozen different ways. This isn't a big issue if you're reading or listening. It won't confuse you. But the moment you start applying formal rules like in a computer, it's a dozen different ways to type it wrong! I like my script for anything other than programming. It's very expressive. But the anemic simplicity of the Latin script is actually a big advantage when it comes to things like programming and mathematics. I believe that you will find many such peculiarities and nuances with other scripts if you go searching.