Re: Selectors API naming

Hi-

Robert Sayre wrote:
> 
> On 12/20/06, Doug Schepers <doug@schepers.cc> wrote:
>>
>> That those methods have "failed" is not conclusive.
> 
> Well, the possibility has certainly been widely discussed.
> <http://www.google.com/search?q=DOM+sucks>

Huh?  The first 2 pages (at least) of that search seemed to complain 
about the lack of consistency in support among different browsers, not 
about the supposed "failure" of the longer DOM method names. [1]

For me, failure in a method name would be if:
a) the functionality of the name was unclear because of
a1) ambiguity in the functionality (what it returns, from where, and by 
which criteria)
a2) conceptual conflict with another method name with differing 
functionality
b) the name somehow prevents interoperable support (maybe by practical 
conflict with a different method)
c) the name somehow prevented or discouraged authors or implementors 
from using the method (again, maybe by lack of clarity for its intended 
purpose)

I think a good example of a bad example is (famously) XmlHttpRequest. 
The technology was there.  The idea was good.  The functionality solved 
a problem that needed solving.  The method was supported in IE when that 
browser had almost all the market share.  Why didn't it take off?  Why 
did people only really start using it, what, 3 or 4 years later?  One 
possible explanation is simply the climate at the time... the bubble had 
burst.  But I suspect that casual programmers just didn't know what it 
did, or how to use it.  The name is not descriptive, the manner in which 
to use it is not intuitive or consistent with most other DOM methods. 
In contrast, Adobe introduced similar functionality under the names 
document.getURL() and document.postURL() for the much more obscure 
language SVG, and it took off right away in that developer community.

Also, another case in point: getElementsByTagName() and 
getElementById(), while admittedly verbose, are used everywhere 
(sometimes even by alias :).

None of this is proof that longer, more descriptive names are more 
subject to uptake, of course... but then neither is the shortname 
aliasing of some libraries proof (or even evidence, in my opinion) that 
those weighty extra 14 letters either prevent use or cause 
interoperability problems (i.e. "fail").

Regards-
-Doug

[1] FWIW, I also tried googling for "robots+kill" and 
"fluffy+bunnies+eat+grass", but couldn't find any relevant information 
on the topic there either, oddly enough.

Received on Thursday, 21 December 2006 02:00:33 UTC