[Python-ideas] Visually confusable unicode characters in identifiers

Massimo DiPierro massimo.dipierro at gmail.com
Mon Oct 1 21:29:46 CEST 2012


Hello Guido,

it does make sense. The only point I tried to make is that, because something is allowed, it does mean it should be encouraged.
I am sure there are instructors who want to teach to code using Japanese of Chinese variable names. Python gives them a way to do so. 
Yet, if they do so, they would be isolating their students and their code from the rest of the world.

Massimo


On Oct 1, 2012, at 12:51 PM, Guido van Rossum wrote:

> On Mon, Oct 1, 2012 at 10:18 AM, Massimo DiPierro
> <massimo.dipierro at gmail.com> wrote:
>> The great thing about open source is that is has brought the world together. I am not an english speaker and I learned the meaning of IF, THEN, FOR, WHILE, not in the context of the English language, but as keywords of the Basic programming language. The fact that they are english words has is accidental. The great thing about code is (used to be) that anybody can read and understand what others write.
>> 
>> When I used program in Italy, I had to deal with latin-1 characters. This was never a problem. Not even in Cobol, Basic, Clipper, or Paradox because data should be separated from code. Data may contain latin-1 or unicode or whatever. Code always contains ASCII and if one does not mix the two there is never a problem.
>> 
>> Allowing unicode in variable names blurs this separation. It makes code written people speaking one language unreadable by people speaking a different language.
>> 
>> I should point out that most of my students are Chinese. They do not have any problem with reading and writing code using the english alphabet.
>> 
>> Any one of us could design better power plugs for our homes. That does not mean it would be a good idea to do so.
> 
> Our posts crossed. I hope my explanation makes sense to you. The age /
> grade level of students probably matters; all classes in middle or
> high school are typically taught in the native language, but in
> University more and more courses are taught in English (some European
> countries are even making English the mandatory teachkng language at
> the University level).
> 
> Not everything you design is meant to be a better power plug for the
> world. Sometimes you just need to find a way to fit *your* oven in
> *your* cabinet, and cutting up some planks in a way that wouldn't work
> for anyone else is fine.
> 
> -- 
> --Guido van Rossum (python.org/~guido)




More information about the Python-ideas mailing list