20.06.2012, 00:38, "Tab Atkins Jr." <jackalm...@gmail.com>:
> On Mon, Jun 18, 2012 at 10:59 PM, Simon Pieters <sim...@opera.com> wrote:
>
>>  On Mon, 18 Jun 2012 16:57:17 +0200, Kang-Hao (Kenny) Lu
>>  <kennyl...@csail.mit.edu> wrote:
>>  We have lots of shipped APIs with worse names. I think we should live with
>>  past mistakes, try not to make them again, and move on.
>
> This is not a good argument.  qSA is used often enough, and has a long
> enough name, that the name is actually a pretty significant
> misfeature.  This is a pretty core API, and both it and its precursors
> (getElementByID, etc.) are very commonly renamed by libraries
> precisely because you need a very short name for such a commonly used
> function.

There is a key difference between native functionality and one implemented as a 
library -- they quite differently relate to backward compatibility. A library 
can be rewritten partially or even entirely if needed (older applications can 
just continue using older versions of the library), while native functionality, 
once widely implemented, have to be supported forever and in fact cannot (and 
should never) be dropped. 

As for `querySelector()` in particular, its name is indeed not the best, but 
_not_ because it's too long, but because it's not quite _clear_ / 
_self-documenting_. `querySelector()` and `querySelectorAll()` should have been 
named `getElementBySelector()` and `getElementsBySelector()` instead.

In this regard, `find()` is far less clear (and even confusing) as for what it 
does.

Reply via email to