[XML-SIG] Ugh! Why are DOM access methods spelled with a leading '_'?

Walter Doerwald walter@livinglogic.de
Mon, 26 Jun 2000 17:15:53 +0200

At 02:37 26.06.00, you wrote:

I should note that I quite hope that leading-underscore-means-private is
indeed not normative, and never will be so.  The leading underscore is the
most readable way to escape symbol names that would clash with an applicable
naming convention.  It's far from a conclusive argument (though Jim Fulton
tried to make a similar argument to excoriate the Python/CORBA binding), but
most languages, such as C++ allow exactly this approach as put to good use=
the C++/CORBA binding.

The leading-underscore-is-private idea has the annoying effect that if I=
to call a variable "class", I must instead use the silly "klass", rather=
"_class", which is far more readable and self-explanatory.  And if I want to
call variables "def", "type" and "else", what then?  "deph", "tipe" and=
  (I suppose one could use trailing underscore).

Most likely, Guido is already in his time machine writing "Thou shalt not=
leading underscore except for private variables" on a stone tablet somewhere
in the past to end the whole argument.  But people have been saying nasty
things about the Python/CORBA binding which wouldn't be as nasty as the=
I'd say about such a restriction in Python.

Well the Python style guide=
    * _single_leading_underscore: weak "internal use" indicator
      (e.g. "from M import *" does not import objects whose name starts with
      an underscore).
    * single_trailing_underscore_: used by convention to avoid conflicts=
      Python keyword, e.g. Tkinter.Toplevel(master, class_=3D"ClassName").

	Walter D=F6rwald
Walter D=F6rwald =B7 LivingLogic AG =B7 Bayreuth, Germany =B7 www.livinglogi=