Re: [selectors api] Why two methods?

On 1/25/07, Jim Ley <jim@jibbering.com> wrote:
>
> "David Håsäther" <hasather@gmail.com>
> > On 2007-01-25 20:42, Anne van Kesteren wrote:
> >> On Thu, 25 Jan 2007 14:39:46 -0500, David Håsäther <hasather@gmail.com>
> >> wrote:
> >>> Why does the Selectors API define two methods for retrieving nodes?
> >>>
> >>> I understand that there are speed gains by having a method that grabs
> >>> just the first node, but how often do you want to do that? Don't you
> >>> want to grab the second node as often? Or the last?
> >>
> >> How do you mean?
> >
> > Sorry for not being clear.
> > What I mean is, why does grabbing the first node deserve its own method?
> > Is that really a common thing to do, grabbing the first node? More common
> > than grabbing the second or last node for instance?
>
> I do agree with this, there seems to be very few use cases where just 1 is
> useful and the user is not going to be able to use .getElementById instead.

Yeah, I also think that defining a method that only grabs the first
node is unnecessary.

Regards,
Martijn

Received on Saturday, 27 January 2007 13:17:31 UTC