Selectors API Naming Debate Revisited

Written by

in

, ,

2 months ago, I reported that I had resolved the Selectors API naming debate. Well, sadly, those names didn’t work out and I got overruled :-(. We ended up holding a Working Group vote to resolve the issue and, as a result, a new set of names were chosen.

The winners were announced just over a week ago: querySelector() and querySelectorAll(). These names already appear in the editors draft, which will soon be publised as a Last Call Working Draft.

Comments

9 responses to “Selectors API Naming Debate Revisited”

  1. Dean Edwards Avatar

    So. Are you done? 😉

  2. minghong Avatar

    > querySelector()/querySelectorAll() scored 41
    > getElementBySelector()/getElementListBySelector() scored 43

    Why NOT getElementBySelector()/getElementListBySelector() scored?!

  3. minghong Avatar

    Typo. I mean, why NOT getElementBySelector()/getElementListBySelector()?!

  4. Lachlan Hunt Avatar

    minghong, the lowest score won because we were asked to rank the choices from most preferred (1) to least preferred (7). See the results page. (Note: I had linked to the wrong results page in the article, but that’s been corrected now)

  5. Martijn Avatar
    Martijn

    Note that originally getElementsBySelector() was voted for, but the editors didn’t like that name at all, so they basically went their own way.
    Please correct me if I’m wrong.

    Current names are a deviation of what there already is, like getElementByID/getElementsByTagName.

  6. Marcos Caceres Avatar

    I still like “$$()”;)

  7. Glen Avatar
    Glen

    querySelector is just wrong … you aren’t asking a “Selector” object for something, you’re using a selector to find elements.

    selectElement is far more logical and correct.

    Oh well, too late.

    I posted a message to the mailing list about this and it seems it was rejected/deleted. That’s just impolite.

  8. Lachlan Hunt Avatar

    Glen, when did you e-mail the list about this? If it was recently, then I didn’t receive it and it’s likely that your mail was held by the list moderation system that requires first time posters to agree to have their emails archived.

    Anyway, you’re right about the names, but there’s nothing I could do about it.

  9. Glen Avatar
    Glen

    Hi Lachlan, it was on Friday (June 19). I did agree to archiving.

    No worries, it’s not important.