W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: [selectors-api] Consider backporting find() behavior to querySelector()

From: Elliott Sprehn <esprehn@gmail.com>
Date: Tue, 19 Jun 2012 21:19:22 -0700
Message-ID: <CAPJYB1gZ1=pb5dfEhjiR=tYONCAg0eCjVNjL4RPWNYAnm4o=3g@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Simon Pieters <simonp@opera.com>, "Kang-Hao (Kenny) Lu" <kennyluck@csail.mit.edu>, "public-webapps.w3.org" <public-webapps@w3.org>
On Tue, Jun 19, 2012 at 1:38 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> ...
> 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.

Why does it need a short name? If the name is too long to type then that's
an argument for better IDEs. Otherwise you end up with stuff like strncpy
to "save typing". gzip eliminates the file size issue.

I'm in agreement with Marat that find() is not as clear as most DOM APIs
usually are. findBySelector() makes much more sense.

- Elliott

- E
Received on Wednesday, 20 June 2012 04:20:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:34 UTC