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

Uche Ogbuji uogbuji@fourthought.com
Tue, 27 Jun 2000 14:12:25 -0600

> > Attributes:
> >         * arguably more Pythonic (=easier to use)
> I think that this extremely arguable.  Many people would argue 
> that it's less OO and, therefore less Pythonic. I obviously
> (from other work) think computed attributes are OK, however, I
> think they have significant downsides, especially for an API
> that we might want people to implement.

There are many features of Python that are not OO.  That's why Python is quite 
popular among those (including me, as you know), who think that OO at any cost 
is dangerous.

IMO, direct attribute access is very Pythonic, though it may not be C++-like 
or Java-like or Smalltalk-like...

> > There are no killer arguments here, just different weights applied to
> > the various features. I don't think that we are going to agree to break
> > code today. Maybe later we'll see that there are more DOM implementors
> > than clients and their ease of implementation will take precedence.
> Do you really think that "x.getY()" is significantly harder to use
> than "x.y"?

As a _heavy_ user of DOM (in XPath and XSLT as well as in client code), and 
having made the conversion from the former to the latter, I'd say "yes".  It's 
also less readable and less natural for a good deal of the attributes.

> I can definately tell you that computed attributes are very significantly
> much harder to implement than accessor functions.

They are harder, but again, having implemented them, not so much harder as to 
be forbidding.

Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +01 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python