72 messages in org.w3.public-webapiRe: ACTION-87: Selectors API
FromSent OnAttachments
Anne van KesterenFeb 25, 2006 9:11 am.htm
Daniel SchierbeckFeb 25, 2006 10:18 am 
Daniel SchierbeckFeb 25, 2006 10:23 am 
Bjoern HoehrmannFeb 25, 2006 10:43 am 
Daniel SchierbeckFeb 25, 2006 11:28 am 
Jim LeyFeb 25, 2006 11:47 am 
Ian HicksonFeb 25, 2006 3:56 pm 
Cameron McCormackFeb 25, 2006 4:46 pm 
Lachlan HuntFeb 25, 2006 4:58 pm 
Cameron McCormackFeb 25, 2006 5:00 pm 
Daniel SchierbeckFeb 25, 2006 5:24 pm 
Anne van KesterenFeb 26, 2006 2:21 am 
Cameron McCormackFeb 26, 2006 2:32 am 
Cameron McCormackFeb 26, 2006 1:03 pm 
Maciej StachowiakFeb 26, 2006 3:02 pm 
Jonas SickingFeb 28, 2006 1:57 pm 
Ian HicksonMar 6, 2006 12:33 pm 
Ian HicksonMar 6, 2006 12:35 pm 
Anne van KesterenMar 22, 2006 2:30 am 
Anne van KesterenMar 22, 2006 2:33 am 
Anne van KesterenMar 22, 2006 2:34 am 
mozerMar 22, 2006 3:15 am 
Anne van KesterenMar 22, 2006 3:58 am 
mozerMar 22, 2006 4:29 am 
Anne van KesterenMar 22, 2006 4:36 am 
Jim LeyMar 22, 2006 5:43 am 
Anne van KesterenMar 22, 2006 6:08 am 
Jim LeyMar 22, 2006 6:44 am 
Maciej StachowiakMar 22, 2006 11:16 am 
Maciej StachowiakMar 22, 2006 11:22 am 
Maciej StachowiakMar 22, 2006 11:24 am 
Robin BerjonMar 22, 2006 2:01 pm 
Maciej StachowiakMar 22, 2006 2:28 pm 
Ian HicksonMar 22, 2006 2:48 pm 
Ian HicksonMar 22, 2006 2:50 pm 
Maciej StachowiakMar 22, 2006 3:20 pm 
Jim LeyMar 22, 2006 6:16 pm 
Jim LeyMar 22, 2006 6:24 pm 
Anne van KesterenMar 23, 2006 4:27 am 
Ian HicksonMar 23, 2006 2:30 pm 
Anne van KesterenMar 25, 2006 4:36 am 
Ian HicksonMar 27, 2006 3:13 pm 
Anne van KesterenApr 3, 2006 5:45 am 
Anne van KesterenApr 3, 2006 5:51 am 
lioreanMay 12, 2006 8:49 pm 
Anne van KesterenMay 13, 2006 4:15 am 
lioreanMay 13, 2006 12:08 pm 
Anne van KesterenMay 13, 2006 12:26 pm 
lioreanMay 13, 2006 2:39 pm 
Anne van KesterenMay 14, 2006 7:20 am 
lioreanMay 14, 2006 4:21 pm 
Anne van KesterenMay 15, 2006 3:15 am 
lioreanMay 16, 2006 9:29 pm 
Anne van KesterenMay 17, 2006 5:17 am 
Lachlan HuntMay 17, 2006 6:19 am 
Anne van KesterenMay 17, 2006 6:29 am 
Jim LeyMay 17, 2006 6:35 am 
Lachlan HuntMay 17, 2006 7:02 am 
Robin BerjonMay 17, 2006 7:07 am 
Anne van KesterenMay 18, 2006 12:45 am 
Jonas SickingMay 30, 2006 3:11 pm 
Jonas SickingMay 30, 2006 3:24 pm 
Jonas SickingMay 30, 2006 3:41 pm 
Ian HicksonMay 30, 2006 3:55 pm 
Robin BerjonMay 30, 2006 4:14 pm 
Jonas SickingMay 30, 2006 5:56 pm 
Anne van KesterenJun 5, 2006 2:46 am 
Anne van KesterenJun 5, 2006 2:49 am 
Jonas SickingJun 5, 2006 12:30 pm 
Charles McCathieNevileJun 5, 2006 5:36 pm 
lioreanJun 5, 2006 6:16 pm 
Maciej StachowiakJun 5, 2006 10:40 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: ACTION-87: Selectors APIActions...
From:liorean (lior@gmail.com)
Date:Jun 5, 2006 6:16:31 pm
List:org.w3.public-webapi

On Mon, 05 Jun 2006 19:49:36 +1000, Anne van Kesteren <ann@opera.com> wrote:

I'm not really fond of matchOne()... Is there any precedence on this?

Not in JavaScript that I can think of. The only precedent case I can think of for this example is String.prototype.match. That function does both though; it's the "global" flag on the regex that determines whether to return just the first match or all of them. And in my mind, that is a design error in regex in JavaScript, since it's entirely plausible to want to use the same regex in both types of matches. This can be done by setting the global flag on the regex and using RegExp.prototype.exec when a single match is desired and String.prototype.match when an array of matches is wanted Just the fact you have to change whether it's the regex or the string that you call a method on - not to speak of the fact you need to set the global flag on all regexes if you want this behaviour uniformly - makes this an ugly solution to my eyes. The responsibility for solving problems like this should lie on the functionality provider, not the functionality consumer.

On 06/06/06, Charles McCathieNevile <cha@opera.com> wrote:

There is a precedent for any naming thing you care to consider, and some you would prefer not to.

Indeed... I think my example highlights that.

I am with Jonas on this - I don't think the name hurts or increases confusion and it does slightly decrease it. But picking names is always painful. We'll never get it perfectly right, but we can always get it oh-so-very wrong :(

I tend to agree here. I don't like the suggested design of having selectors be second class though. I think selectors are important enough to have as first class objects, just like regex are. Compile them to an object once, use multiple times. Little is lost in performance for those using them once, but much is gained for those using them over and over. It makes the code for a single use a little more complex, but not that very much. It doesn't make much of a difference in code complexity for those using them multiple times, and might even mean a reduction in code complexity. It does make up the question of whether the methods for matching should be placed on the Selectors objects or the Document/Element nodes though. -- David "liorean" Andersson <uri:http://liorean.web-graphics.com/>