PEP 263 comments

Stephen J. Turnbull stephen at xemacs.org
Fri Mar 1 00:40:22 EST 2002


>>>>> "Carel" == Carel Fellinger <cfelling at iae.nl> writes:

    Carel> Stephen J. Turnbull <stephen at xemacs.org> wrote:

    Carel> Now that we have your attention, what's your personal
    Carel> opinion on using something else but ascii (in whatever
    Carel> encoding:) for the code itself (things like keywords and
    Carel> variable names).

My _very_ personal opinion is that identifiers can be run through an
online dictionary, and I'm fortunate to be pretty good at languages,
so that's fun.  Nor do I do programming for a living, I can afford to
concentrate on "fun."

My opinion as a teacher is that I'd really like to be able to teach
programming to my freshmen with a language that uses Japanese
identifiers (including reserved words) and syntax (Japanese is a
reverse Polish language).

    Carel> My Western centered view would be that it would make
    Carel> reading code harder, but that's probably what the rest of
    Carel> the world already experiences.

For "real-world" use, I mostly agree that sticking to English is
better, for code.  None of the Japanese programmers I know feel that
use of English for identifiers and reserved words hinders them.  In
fact, some think it may help somewhat, as it allows them to abstract
from any connotations that the word may have in natural language.
(Note that this implies that second courses in programming should use
an English-based language.)

There are exceptions, however.  I maintain code that implements
Japanese input methods in XEmacs, and even native speakers of Japanese
sometimes get confused about what certain identifiers drawn from
English, or even romanized Japanese, are supposed to mean.

On the other hand, edict.el, which implements morphological
transformations for dictionary lookup, uses mixed English-Japanese
identifiers.  The verbs (search, transform, etc) are English; the
parts of speech and technical names for transformations are Japanese
(ie, ideographs).  Nobody (who is competent to understand what the
code does) ever makes a mistake.

This is a very special case, of course.  But you can imagine many
cases where an organization has internal practices that would best be
described in native vocabulary.  Then it's a tradeoff between
short-term maintainability and long-term internationalizability.

    Carel> I even try to stick to English in my comments, just in case
    Carel> some foreignor might have to look at it:)

If it weren't for the "groetjes, carel" in your .sig, I'd not be able
to say with confidence you're not a native English-speaker.  Despite
the excellent English educational system, I cannot say the same for
Indians in general.  Most are sufficiently fluent that your practice
would make sense, but many are not.  And Japanese are legendarily bad
at English.

A correct comment in an illegible character set is harmless, although
perhaps frustrating; an incorrect one that you can read is dangerous.
So I'd have to say that except for the very worst cases, there are
benefits to having code in English, or near-English, vocabulary.  But
comments should be written in a language you can use for teaching.


-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
              Don't ask how you can "do" free software business;
              ask what your business can "do for" free software.



More information about the Python-list mailing list