jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Mitchell Waite-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


What do you guys think of this critique of jQuery I found on Simon
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/

<quote>
jQuery is definitely a popular utility function library, but the sheer
amount of dual/triple/quadruple special-case uses for both function
calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM
element, create a DOM element from HTML and assign a DOMContentReady
event handler - and probably more. Event handling is separated into
separate methods for each event type. Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if a
method acts on the first element in the collection or all of them.

I can't recommend jQuery to the developers I am mentoring because it
is in itself a completely separate abstraction, and a muddy one at
that. They will end up having to learn jQuery instead of having to
learn DOM, CSS and JS, and when being considered as a direct
replacement for those it fails both due to complexity and
inconsistency."

</quote>

Mitch


Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I don't understand this argument at all. So this guy is proposing that
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a
language that can overload arguments and not actually using that
feature? What's the advantage of increasing the size of your API
4-fold?

Incredibly weak argument, obviously someone who's never used the library.

> Some method names make no
> immediate sense, like .one or .eq, and you can't immediately tell if a
> method acts on the first element in the collection or all of them.

These arguments are slightly more valid. Although .eq() is going away
in 1.2. I really don't know what to say, in this case it was simply a
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why
not overload it to actually do something? Why double the size of the
effective API with half-useful functions?

--John

On 8/16/07, Mitch <goofy167@...> wrote:

>
> What do you guys think of this critique of jQuery I found on Simon
> Willison's site (which is good reading).
>
> http://simonwillison.net/2007/Aug/15/jquery/
>
> <quote>
> jQuery is definitely a popular utility function library, but the sheer
> amount of dual/triple/quadruple special-case uses for both function
> calls and method names is an instant turnoff for me.
>
> The jQuery object itself can perform a selector query, embed a DOM
> element, create a DOM element from HTML and assign a DOMContentReady
> event handler - and probably more. Event handling is separated into
> separate methods for each event type. Some method names make no
> immediate sense, like .one or .eq, and you can't immediately tell if a
> method acts on the first element in the collection or all of them.
>
> I can't recommend jQuery to the developers I am mentoring because it
> is in itself a completely separate abstraction, and a muddy one at
> that. They will end up having to learn jQuery instead of having to
> learn DOM, CSS and JS, and when being considered as a direct
> replacement for those it fails both due to complexity and
> inconsistency."
>
> </quote>
>
> Mitch
>
>

Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Stephan Beal-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Aug 16, 7:39 pm, Mitch <goofy...@...> wrote:
> <quote>
> jQuery is definitely a popular utility function library, but the sheer
> amount of dual/triple/quadruple special-case uses for both function
> calls and method names is an instant turnoff for me.

This also turns me off to some degree. The main problem i have is that
jQuery(...) can take so many different argument types. In fact,
jQuery(function(){...}) as a shortcut for $(document).ready(function()
{...}) bugs me the most.

> immediate sense, like .one or .eq, and you can't immediately tell if a
> method acts on the first element in the collection or all of them.

i agree that gt(), lt(), eq(), get(), etc, could/should have been more
verbosely named. Shortcuts like lt, gt, etc. may be familiar to people
who use the Unix shell (test 4 -lt 3), but they're simply opaque to
anyone else.

> I can't recommend jQuery to the developers I am mentoring because it
> is in itself a completely separate abstraction

An interesting point - don't recommend jQ IF the point of your work is
teaching JavaScript.

>, and a muddy one at
> that.

Probably over-stated.

> They will end up having to learn jQuery instead of having to
> learn DOM, CSS and JS, and when being considered as a direct
> replacement for those it fails both due to complexity and
> inconsistency."

Again, over-stated.

Summary:

The author has apparently let a couple of relatively minor details get
on his nerves, to the point that he can no longer reconcile his
feelings. i can relate to this - i hate/despise/refuse to use Python
because whitespace is significant in that language (and whitespace
should rarely, if ever, be significant), and its completely naive
approach to implementing package-private data. Technosophically
speaking, i simply cannot excuse those failings of the language, and
refuse to learn it on those grouds. Simon Willison apparently has a
similar hang-up about jQuery. And, like i am in my hate-hate
relationship with Python, he's in the minority.



Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by lists-146 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


John...

To be fair...it's very easy to learn the basics of jQuery, but it's quite a
lot of work and time to learn the really cool stuff. I've never used eq() or
if() and those other because I simply don't understand what they do. I'm
sure some of them could improve my code dramatically but I don't even know
WHEN I might use them, so I don't know when to look for them. Does that
makes sense?

andy

-----Original Message-----
From: jquery-en@... [mailto:jquery-en@...] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
To: jquery-en@...
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that we
change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a language
that can overload arguments and not actually using that feature? What's the
advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.

> Some method names make no
> immediate sense, like .one or .eq, and you can't immediately tell if a
> method acts on the first element in the collection or all of them.

These arguments are slightly more valid. Although .eq() is going away in
1.2. I really don't know what to say, in this case it was simply a design
decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why not
overload it to actually do something? Why double the size of the effective
API with half-useful functions?

--John

On 8/16/07, Mitch <goofy167@...> wrote:

>
> What do you guys think of this critique of jQuery I found on Simon
> Willison's site (which is good reading).
>
> http://simonwillison.net/2007/Aug/15/jquery/
>
> <quote>
> jQuery is definitely a popular utility function library, but the sheer
> amount of dual/triple/quadruple special-case uses for both function
> calls and method names is an instant turnoff for me.
>
> The jQuery object itself can perform a selector query, embed a DOM
> element, create a DOM element from HTML and assign a DOMContentReady
> event handler - and probably more. Event handling is separated into
> separate methods for each event type. Some method names make no
> immediate sense, like .one or .eq, and you can't immediately tell if a
> method acts on the first element in the collection or all of them.
>
> I can't recommend jQuery to the developers I am mentoring because it
> is in itself a completely separate abstraction, and a muddy one at
> that. They will end up having to learn jQuery instead of having to
> learn DOM, CSS and JS, and when being considered as a direct
> replacement for those it fails both due to complexity and
> inconsistency."
>
> </quote>
>
> Mitch
>
>



Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Sure, that makes sense - and it's obviously difficult. I think the
burden may lie on us to write better examples - although, it's hard to
think of ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a
plugin is unable to duplicate functionality (or where a plugin would
be hugely bloated, where the result in core would be quite simple,
instead).

That being said, I'm still advancing the library with some fun methods
like .andSelf() whose uses won't become commonly apparent until far
down the line.

--John

On 8/16/07, Andy Matthews <lists@...> wrote:

>
> John...
>
> To be fair...it's very easy to learn the basics of jQuery, but it's quite a
> lot of work and time to learn the really cool stuff. I've never used eq() or
> if() and those other because I simply don't understand what they do. I'm
> sure some of them could improve my code dramatically but I don't even know
> WHEN I might use them, so I don't know when to look for them. Does that
> makes sense?
>
> andy
>
> -----Original Message-----
> From: jquery-en@... [mailto:jquery-en@...] On
> Behalf Of John Resig
> Sent: Thursday, August 16, 2007 12:53 PM
> To: jquery-en@...
> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
> uses for both function calls and method names
>
>
> I don't understand this argument at all. So this guy is proposing that we
> change all the jQuery methods to:
>
> $Array([array of elems])
> $Selector("str")
> $HTML("html")
> $Element(DOMElement)
>
> and:
>
> .appendElement(DOMElement)
> .appendHTML("html")
> .appendArray([array of elems])
>
> what on earth does that gain you? What's the purpose of using a language
> that can overload arguments and not actually using that feature? What's the
> advantage of increasing the size of your API 4-fold?
>
> Incredibly weak argument, obviously someone who's never used the library.
>
> > Some method names make no
> > immediate sense, like .one or .eq, and you can't immediately tell if a
> > method acts on the first element in the collection or all of them.
>
> These arguments are slightly more valid. Although .eq() is going away in
> 1.2. I really don't know what to say, in this case it was simply a design
> decision. We could've had:
> .val() (return nothing, do nothing useful)
> .val("val") (set value)
> .getVal() (get value)
> .getVal("val") (return nothing, do nothing useful)
>
> But why have a state of a method perform nothing useful at all? Why not
> overload it to actually do something? Why double the size of the effective
> API with half-useful functions?
>
> --John
>
> On 8/16/07, Mitch <goofy167@...> wrote:
> >
> > What do you guys think of this critique of jQuery I found on Simon
> > Willison's site (which is good reading).
> >
> > http://simonwillison.net/2007/Aug/15/jquery/
> >
> > <quote>
> > jQuery is definitely a popular utility function library, but the sheer
> > amount of dual/triple/quadruple special-case uses for both function
> > calls and method names is an instant turnoff for me.
> >
> > The jQuery object itself can perform a selector query, embed a DOM
> > element, create a DOM element from HTML and assign a DOMContentReady
> > event handler - and probably more. Event handling is separated into
> > separate methods for each event type. Some method names make no
> > immediate sense, like .one or .eq, and you can't immediately tell if a
> > method acts on the first element in the collection or all of them.
> >
> > I can't recommend jQuery to the developers I am mentoring because it
> > is in itself a completely separate abstraction, and a muddy one at
> > that. They will end up having to learn jQuery instead of having to
> > learn DOM, CSS and JS, and when being considered as a direct
> > replacement for those it fails both due to complexity and
> > inconsistency."
> >
> > </quote>
> >
> > Mitch
> >
> >
>
>
>

Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by lists-146 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


John...

I should have added on to my OP. Better examples are really what is needed,
not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy

-----Original Message-----
From: jquery-en@... [mailto:jquery-en@...] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
To: jquery-en@...
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a plugin is
unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods like
.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <lists@...> wrote:

>
> John...
>
> To be fair...it's very easy to learn the basics of jQuery, but it's
> quite a lot of work and time to learn the really cool stuff. I've
> never used eq() or
> if() and those other because I simply don't understand what they do.
> I'm sure some of them could improve my code dramatically but I don't
> even know WHEN I might use them, so I don't know when to look for
> them. Does that makes sense?
>
> andy
>
> -----Original Message-----
> From: jquery-en@... [mailto:jquery-en@...]
> On Behalf Of John Resig
> Sent: Thursday, August 16, 2007 12:53 PM
> To: jquery-en@...
> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> special-case uses for both function calls and method names
>
>
> I don't understand this argument at all. So this guy is proposing that
> we change all the jQuery methods to:
>
> $Array([array of elems])
> $Selector("str")
> $HTML("html")
> $Element(DOMElement)
>
> and:
>
> .appendElement(DOMElement)
> .appendHTML("html")
> .appendArray([array of elems])
>
> what on earth does that gain you? What's the purpose of using a
> language that can overload arguments and not actually using that
> feature? What's the advantage of increasing the size of your API 4-fold?
>
> Incredibly weak argument, obviously someone who's never used the library.
>
> > Some method names make no
> > immediate sense, like .one or .eq, and you can't immediately tell if
> > a method acts on the first element in the collection or all of them.
>
> These arguments are slightly more valid. Although .eq() is going away
> in 1.2. I really don't know what to say, in this case it was simply a
> design decision. We could've had:
> .val() (return nothing, do nothing useful)
> .val("val") (set value)
> .getVal() (get value)
> .getVal("val") (return nothing, do nothing useful)
>
> But why have a state of a method perform nothing useful at all? Why
> not overload it to actually do something? Why double the size of the
> effective API with half-useful functions?
>
> --John
>
> On 8/16/07, Mitch <goofy167@...> wrote:
> >
> > What do you guys think of this critique of jQuery I found on Simon
> > Willison's site (which is good reading).
> >
> > http://simonwillison.net/2007/Aug/15/jquery/
> >
> > <quote>
> > jQuery is definitely a popular utility function library, but the
> > sheer amount of dual/triple/quadruple special-case uses for both
> > function calls and method names is an instant turnoff for me.
> >
> > The jQuery object itself can perform a selector query, embed a DOM
> > element, create a DOM element from HTML and assign a DOMContentReady
> > event handler - and probably more. Event handling is separated into
> > separate methods for each event type. Some method names make no
> > immediate sense, like .one or .eq, and you can't immediately tell if
> > a method acts on the first element in the collection or all of them.
> >
> > I can't recommend jQuery to the developers I am mentoring because it
> > is in itself a completely separate abstraction, and a muddy one at
> > that. They will end up having to learn jQuery instead of having to
> > learn DOM, CSS and JS, and when being considered as a direct
> > replacement for those it fails both due to complexity and
> > inconsistency."
> >
> > </quote>
> >
> > Mitch
> >
> >
>
>
>



Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


That'd be excellent - thanks!

--John

On 8/16/07, Andy Matthews <lists@...> wrote:

>
> John...
>
> I should have added on to my OP. Better examples are really what is needed,
> not changes to the language. Let me read through and see possible RW
> examples of eq() or is() and let me say "hey I did that very thing last
> week, but with 10 more lines of code)".
>
> andy
>
> -----Original Message-----
> From: jquery-en@... [mailto:jquery-en@...] On
> Behalf Of John Resig
> Sent: Thursday, August 16, 2007 1:48 PM
> To: jquery-en@...
> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
> uses for both function calls and method names
>
>
> Sure, that makes sense - and it's obviously difficult. I think the burden
> may lie on us to write better examples - although, it's hard to think of
> ones that aren't complex that also aren't contrived.
>
> At this point, I look for fringe cases in jQuery where, simply, a plugin is
> unable to duplicate functionality (or where a plugin would be hugely
> bloated, where the result in core would be quite simple, instead).
>
> That being said, I'm still advancing the library with some fun methods like
> .andSelf() whose uses won't become commonly apparent until far down the
> line.
>
> --John
>
> On 8/16/07, Andy Matthews <lists@...> wrote:
> >
> > John...
> >
> > To be fair...it's very easy to learn the basics of jQuery, but it's
> > quite a lot of work and time to learn the really cool stuff. I've
> > never used eq() or
> > if() and those other because I simply don't understand what they do.
> > I'm sure some of them could improve my code dramatically but I don't
> > even know WHEN I might use them, so I don't know when to look for
> > them. Does that makes sense?
> >
> > andy
> >
> > -----Original Message-----
> > From: jquery-en@... [mailto:jquery-en@...]
> > On Behalf Of John Resig
> > Sent: Thursday, August 16, 2007 12:53 PM
> > To: jquery-en@...
> > Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > special-case uses for both function calls and method names
> >
> >
> > I don't understand this argument at all. So this guy is proposing that
> > we change all the jQuery methods to:
> >
> > $Array([array of elems])
> > $Selector("str")
> > $HTML("html")
> > $Element(DOMElement)
> >
> > and:
> >
> > .appendElement(DOMElement)
> > .appendHTML("html")
> > .appendArray([array of elems])
> >
> > what on earth does that gain you? What's the purpose of using a
> > language that can overload arguments and not actually using that
> > feature? What's the advantage of increasing the size of your API 4-fold?
> >
> > Incredibly weak argument, obviously someone who's never used the library.
> >
> > > Some method names make no
> > > immediate sense, like .one or .eq, and you can't immediately tell if
> > > a method acts on the first element in the collection or all of them.
> >
> > These arguments are slightly more valid. Although .eq() is going away
> > in 1.2. I really don't know what to say, in this case it was simply a
> > design decision. We could've had:
> > .val() (return nothing, do nothing useful)
> > .val("val") (set value)
> > .getVal() (get value)
> > .getVal("val") (return nothing, do nothing useful)
> >
> > But why have a state of a method perform nothing useful at all? Why
> > not overload it to actually do something? Why double the size of the
> > effective API with half-useful functions?
> >
> > --John
> >
> > On 8/16/07, Mitch <goofy167@...> wrote:
> > >
> > > What do you guys think of this critique of jQuery I found on Simon
> > > Willison's site (which is good reading).
> > >
> > > http://simonwillison.net/2007/Aug/15/jquery/
> > >
> > > <quote>
> > > jQuery is definitely a popular utility function library, but the
> > > sheer amount of dual/triple/quadruple special-case uses for both
> > > function calls and method names is an instant turnoff for me.
> > >
> > > The jQuery object itself can perform a selector query, embed a DOM
> > > element, create a DOM element from HTML and assign a DOMContentReady
> > > event handler - and probably more. Event handling is separated into
> > > separate methods for each event type. Some method names make no
> > > immediate sense, like .one or .eq, and you can't immediately tell if
> > > a method acts on the first element in the collection or all of them.
> > >
> > > I can't recommend jQuery to the developers I am mentoring because it
> > > is in itself a completely separate abstraction, and a muddy one at
> > > that. They will end up having to learn jQuery instead of having to
> > > learn DOM, CSS and JS, and when being considered as a direct
> > > replacement for those it fails both due to complexity and
> > > inconsistency."
> > >
> > > </quote>
> > >
> > > Mitch
> > >
> > >
> >
> >
> >
>
>
>

Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Karl Swedberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andy, 

I realize these are contrived examples, but if you're interested in seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can be used for, here are a few links that might be helpful:


http://book.learningjquery.com/3810_03_code/traversing.html


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:


John...

I should have added on to my OP. Better examples are really what is needed,
not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy 

-----Original Message-----
From: jquery-en@... [mailto:jquery-en@...] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a plugin is
unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods like
.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <lists@...> wrote:

John...

To be fair...it's very easy to learn the basics of jQuery, but it's 
quite a lot of work and time to learn the really cool stuff. I've 
never used eq() or
if() and those other because I simply don't understand what they do. 
I'm sure some of them could improve my code dramatically but I don't 
even know WHEN I might use them, so I don't know when to look for 
them. Does that makes sense?

andy

-----Original Message-----
From: jquery-en@... [mailto:jquery-en@...] 
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple 
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that 
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a 
language that can overload arguments and not actually using that 
feature? What's the advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.

Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if 
a method acts on the first element in the collection or all of them.

These arguments are slightly more valid. Although .eq() is going away 
in 1.2. I really don't know what to say, in this case it was simply a 
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why 
not overload it to actually do something? Why double the size of the 
effective API with half-useful functions?

--John

On 8/16/07, Mitch <goofy167@...> wrote:

What do you guys think of this critique of jQuery I found on Simon 
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/

<quote>
jQuery is definitely a popular utility function library, but the 
sheer amount of dual/triple/quadruple special-case uses for both 
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM 
element, create a DOM element from HTML and assign a DOMContentReady 
event handler - and probably more. Event handling is separated into 
separate methods for each event type. Some method names make no 
immediate sense, like .one or .eq, and you can't immediately tell if 
a method acts on the first element in the collection or all of them.

I can't recommend jQuery to the developers I am mentoring because it 
is in itself a completely separate abstraction, and a muddy one at 
that. They will end up having to learn jQuery instead of having to 
learn DOM, CSS and JS, and when being considered as a direct 
replacement for those it fails both due to complexity and 
inconsistency."

</quote>

Mitch









Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by lists-146 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Karl...
 
Where would be the best place for my company to purchase your book so that you will get the maximum benefit?


From: jquery-en@... [mailto:jquery-en@...] On Behalf Of Karl Swedberg
Sent: Thursday, August 16, 2007 2:15 PM
To: jquery-en@...
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

Andy,

I realize these are contrived examples, but if you're interested in seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can be used for, here are a few links that might be helpful:


http://book.learningjquery.com/3810_03_code/traversing.html


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:


John...

I should have added on to my OP. Better examples are really what is needed,
not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy

-----Original Message-----
From: jquery-en@... [mailto:jquery-en@...] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a plugin is
unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods like
.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <lists@...> wrote:

John...

To be fair...it's very easy to learn the basics of jQuery, but it's
quite a lot of work and time to learn the really cool stuff. I've
never used eq() or
if() and those other because I simply don't understand what they do.
I'm sure some of them could improve my code dramatically but I don't
even know WHEN I might use them, so I don't know when to look for
them. Does that makes sense?

andy

-----Original Message-----
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a
language that can overload arguments and not actually using that
feature? What's the advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.

Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.

These arguments are slightly more valid. Although .eq() is going away
in 1.2. I really don't know what to say, in this case it was simply a
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why
not overload it to actually do something? Why double the size of the
effective API with half-useful functions?

--John

On 8/16/07, Mitch <goofy167@...> wrote:

What do you guys think of this critique of jQuery I found on Simon
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/

<quote>
jQuery is definitely a popular utility function library, but the
sheer amount of dual/triple/quadruple special-case uses for both
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM
element, create a DOM element from HTML and assign a DOMContentReady
event handler - and probably more. Event handling is separated into
separate methods for each event type. Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.

I can't recommend jQuery to the developers I am mentoring because it
is in itself a completely separate abstraction, and a muddy one at
that. They will end up having to learn jQuery instead of having to
learn DOM, CSS and JS, and when being considered as a direct
replacement for those it fails both due to complexity and
inconsistency."

</quote>

Mitch









Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by lists-146 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

404 on the first link by the way. Month should be 11, not 12:
 


From: jquery-en@... [mailto:jquery-en@...] On Behalf Of Karl Swedberg
Sent: Thursday, August 16, 2007 2:15 PM
To: jquery-en@...
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

Andy,

I realize these are contrived examples, but if you're interested in seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can be used for, here are a few links that might be helpful:


http://book.learningjquery.com/3810_03_code/traversing.html


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:


John...

I should have added on to my OP. Better examples are really what is needed,
not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy

-----Original Message-----
From: jquery-en@... [mailto:jquery-en@...] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a plugin is
unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods like
.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <lists@...> wrote:

John...

To be fair...it's very easy to learn the basics of jQuery, but it's
quite a lot of work and time to learn the really cool stuff. I've
never used eq() or
if() and those other because I simply don't understand what they do.
I'm sure some of them could improve my code dramatically but I don't
even know WHEN I might use them, so I don't know when to look for
them. Does that makes sense?

andy

-----Original Message-----
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a
language that can overload arguments and not actually using that
feature? What's the advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.

Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.

These arguments are slightly more valid. Although .eq() is going away
in 1.2. I really don't know what to say, in this case it was simply a
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why
not overload it to actually do something? Why double the size of the
effective API with half-useful functions?

--John

On 8/16/07, Mitch <goofy167@...> wrote:

What do you guys think of this critique of jQuery I found on Simon
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/

<quote>
jQuery is definitely a popular utility function library, but the
sheer amount of dual/triple/quadruple special-case uses for both
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM
element, create a DOM element from HTML and assign a DOMContentReady
event handler - and probably more. Event handling is separated into
separate methods for each event type. Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.

I can't recommend jQuery to the developers I am mentoring because it
is in itself a completely separate abstraction, and a muddy one at
that. They will end up having to learn jQuery instead of having to
learn DOM, CSS and JS, and when being considered as a direct
replacement for those it fails both due to complexity and
inconsistency."

</quote>

Mitch









Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Karl Swedberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

oops. thanks for the correction. that's what I get for taking a shortcut. 


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:19 PM, Andy Matthews wrote:

404 on the first link by the way. Month should be 11, not 12:
 


From: jquery-en@... [jquery-en@...] On Behalf Of Karl Swedberg
Sent: Thursday, August 16, 2007 2:15 PM
To: jquery-en@...
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

Andy,

I realize these are contrived examples, but if you're interested in seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can be used for, here are a few links that might be helpful:


http://book.learningjquery.com/3810_03_code/traversing.html


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:


John...

I should have added on to my OP. Better examples are really what is needed,
not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy

-----Original Message-----
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a plugin is
unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods like
.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <lists@...> wrote:

John...

To be fair...it's very easy to learn the basics of jQuery, but it's
quite a lot of work and time to learn the really cool stuff. I've
never used eq() or
if() and those other because I simply don't understand what they do.
I'm sure some of them could improve my code dramatically but I don't
even know WHEN I might use them, so I don't know when to look for
them. Does that makes sense?

andy

-----Original Message-----
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a
language that can overload arguments and not actually using that
feature? What's the advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.

Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.

These arguments are slightly more valid. Although .eq() is going away
in 1.2. I really don't know what to say, in this case it was simply a
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why
not overload it to actually do something? Why double the size of the
effective API with half-useful functions?

--John

On 8/16/07, Mitch <goofy167@...> wrote:

What do you guys think of this critique of jQuery I found on Simon
Willison's site (which is good reading).


<quote>
jQuery is definitely a popular utility function library, but the
sheer amount of dual/triple/quadruple special-case uses for both
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM
element, create a DOM element from HTML and assign a DOMContentReady
event handler - and probably more. Event handling is separated into
separate methods for each event type. Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.

I can't recommend jQuery to the developers I am mentoring because it
is in itself a completely separate abstraction, and a muddy one at
that. They will end up having to learn jQuery instead of having to
learn DOM, CSS and JS, and when being considered as a direct
replacement for those it fails both due to complexity and
inconsistency."

</quote>

Mitch










Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Rey Bango-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Amazon.

Rey

Andy Matthews wrote:

> Karl...
>  
> Where would be the best place for my company to purchase your book so
> that you will get the maximum benefit?
>
> ------------------------------------------------------------------------
> *From:* jquery-en@... [mailto:jquery-en@...]
> *On Behalf Of *Karl Swedberg
> *Sent:* Thursday, August 16, 2007 2:15 PM
> *To:* jquery-en@...
> *Subject:* [jQuery] Re: jQuery negatives: dual/triple/quadruple
> special-case uses for both function calls and method names
>
> Andy,
>
> I realize these are contrived examples, but if you're interested in
> seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can
> be used for, here are a few links that might be helpful:
>
> http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-1
> http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2
>
> http://book.learningjquery.com/3810_02_code/selectors.html
> http://book.learningjquery.com/3810_03_code/traversing.html
>
>
> --Karl
> _________________
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
> On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:
>
>>
>> John...
>>
>> I should have added on to my OP. Better examples are really what is
>> needed,
>> not changes to the language. Let me read through and see possible RW
>> examples of eq() or is() and let me say "hey I did that very thing last
>> week, but with 10 more lines of code)".
>>
>> andy
>>
>> -----Original Message-----
>> From: jquery-en@... [mailto:jquery-en@...] On
>> Behalf Of John Resig
>> Sent: Thursday, August 16, 2007 1:48 PM
>> To: jquery-en@...
>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
>> uses for both function calls and method names
>>
>>
>> Sure, that makes sense - and it's obviously difficult. I think the burden
>> may lie on us to write better examples - although, it's hard to think of
>> ones that aren't complex that also aren't contrived.
>>
>> At this point, I look for fringe cases in jQuery where, simply, a
>> plugin is
>> unable to duplicate functionality (or where a plugin would be hugely
>> bloated, where the result in core would be quite simple, instead).
>>
>> That being said, I'm still advancing the library with some fun methods
>> like
>> .andSelf() whose uses won't become commonly apparent until far down the
>> line.
>>
>> --John
>>
>> On 8/16/07, Andy Matthews <lists@...> wrote:
>>>
>>> John...
>>>
>>> To be fair...it's very easy to learn the basics of jQuery, but it's
>>> quite a lot of work and time to learn the really cool stuff. I've
>>> never used eq() or
>>> if() and those other because I simply don't understand what they do.
>>> I'm sure some of them could improve my code dramatically but I don't
>>> even know WHEN I might use them, so I don't know when to look for
>>> them. Does that makes sense?
>>>
>>> andy
>>>
>>> -----Original Message-----
>>> From: jquery-en@... [mailto:jquery-en@...]
>>> On Behalf Of John Resig
>>> Sent: Thursday, August 16, 2007 12:53 PM
>>> To: jquery-en@...
>>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
>>> special-case uses for both function calls and method names
>>>
>>>
>>> I don't understand this argument at all. So this guy is proposing that
>>> we change all the jQuery methods to:
>>>
>>> $Array([array of elems])
>>> $Selector("str")
>>> $HTML("html")
>>> $Element(DOMElement)
>>>
>>> and:
>>>
>>> .appendElement(DOMElement)
>>> .appendHTML("html")
>>> .appendArray([array of elems])
>>>
>>> what on earth does that gain you? What's the purpose of using a
>>> language that can overload arguments and not actually using that
>>> feature? What's the advantage of increasing the size of your API 4-fold?
>>>
>>> Incredibly weak argument, obviously someone who's never used the library.
>>>
>>>> Some method names make no
>>>> immediate sense, like .one or .eq, and you can't immediately tell if
>>>> a method acts on the first element in the collection or all of them.
>>>
>>> These arguments are slightly more valid. Although .eq() is going away
>>> in 1.2. I really don't know what to say, in this case it was simply a
>>> design decision. We could've had:
>>> .val() (return nothing, do nothing useful)
>>> .val("val") (set value)
>>> .getVal() (get value)
>>> .getVal("val") (return nothing, do nothing useful)
>>>
>>> But why have a state of a method perform nothing useful at all? Why
>>> not overload it to actually do something? Why double the size of the
>>> effective API with half-useful functions?
>>>
>>> --John
>>>
>>> On 8/16/07, Mitch <goofy167@...> wrote:
>>>>
>>>> What do you guys think of this critique of jQuery I found on Simon
>>>> Willison's site (which is good reading).
>>>>
>>>> http://simonwillison.net/2007/Aug/15/jquery/
>>>>
>>>> <quote>
>>>> jQuery is definitely a popular utility function library, but the
>>>> sheer amount of dual/triple/quadruple special-case uses for both
>>>> function calls and method names is an instant turnoff for me.
>>>>
>>>> The jQuery object itself can perform a selector query, embed a DOM
>>>> element, create a DOM element from HTML and assign a DOMContentReady
>>>> event handler - and probably more. Event handling is separated into
>>>> separate methods for each event type. Some method names make no
>>>> immediate sense, like .one or .eq, and you can't immediately tell if
>>>> a method acts on the first element in the collection or all of them.
>>>>
>>>> I can't recommend jQuery to the developers I am mentoring because it
>>>> is in itself a completely separate abstraction, and a muddy one at
>>>> that. They will end up having to learn jQuery instead of having to
>>>> learn DOM, CSS and JS, and when being considered as a direct
>>>> replacement for those it fails both due to complexity and
>>>> inconsistency."
>>>>
>>>> </quote>
>>>>
>>>> Mitch
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>

Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Glen Lipka :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As a non-programmer, (HTML/CSS only) I understand lt() and gt() mainly because of &lt; and &gt;.
I think those are very easy.  The place I get confused a little is when you can say $("p:gt(4)") and $("p").gt(4) and get the same thing.  Why both?  I suppose the answer is "because some people like it one way and some the other". 

One nice thing about jQuery's insistence on small file size is that it limits the bloat that often comes with other systems.  At first I had a clock.  Now I have clock-radio-alarm-calendar-cd-player.  The clock was easier to use before it had all that power.

Anyway, I am babbling.  Wisdom and Vision are hard things, but I believe jQuery has them both in spades.

Glen

On 8/16/07, Rey Bango <rey@...> wrote:

Amazon.

Rey

Andy Matthews wrote:

> Karl...
>
> Where would be the best place for my company to purchase your book so
> that you will get the maximum benefit?
>
> ------------------------------------------------------------------------
> *From:* jquery-en@... [mailto:jquery-en@...]
> *On Behalf Of *Karl Swedberg
> *Sent:* Thursday, August 16, 2007 2:15 PM
> *To:* jquery-en@...
> *Subject:* [jQuery] Re: jQuery negatives: dual/triple/quadruple
> special-case uses for both function calls and method names
>
> Andy,
>
> I realize these are contrived examples, but if you're interested in
> seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can
> be used for, here are a few links that might be helpful:
>
> http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-1
> http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2
>
> http://book.learningjquery.com/3810_02_code/selectors.html
> http://book.learningjquery.com/3810_03_code/traversing.html
>
>
> --Karl
> _________________
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
> On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:
>
>>
>> John...
>>
>> I should have added on to my OP. Better examples are really what is
>> needed,
>> not changes to the language. Let me read through and see possible RW
>> examples of eq() or is() and let me say "hey I did that very thing last
>> week, but with 10 more lines of code)".
>>
>> andy
>>
>> -----Original Message-----
>> From: jquery-en@... [mailto:jquery-en@...] On
>> Behalf Of John Resig
>> Sent: Thursday, August 16, 2007 1:48 PM
>> To: jquery-en@...
>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
>> uses for both function calls and method names
>>
>>
>> Sure, that makes sense - and it's obviously difficult. I think the burden
>> may lie on us to write better examples - although, it's hard to think of
>> ones that aren't complex that also aren't contrived.
>>
>> At this point, I look for fringe cases in jQuery where, simply, a
>> plugin is
>> unable to duplicate functionality (or where a plugin would be hugely
>> bloated, where the result in core would be quite simple, instead).
>>
>> That being said, I'm still advancing the library with some fun methods
>> like
>> .andSelf() whose uses won't become commonly apparent until far down the
>> line.
>>
>> --John
>>
>> On 8/16/07, Andy Matthews <lists@...> wrote:
>>>
>>> John...
>>>
>>> To be fair...it's very easy to learn the basics of jQuery, but it's
>>> quite a lot of work and time to learn the really cool stuff. I've
>>> never used eq() or
>>> if() and those other because I simply don't understand what they do.
>>> I'm sure some of them could improve my code dramatically but I don't
>>> even know WHEN I might use them, so I don't know when to look for
>>> them. Does that makes sense?
>>>
>>> andy
>>>
>>> -----Original Message-----
>>> From: jquery-en@... [mailto:jquery-en@...]
>>> On Behalf Of John Resig
>>> Sent: Thursday, August 16, 2007 12:53 PM
>>> To: jquery-en@...
>>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
>>> special-case uses for both function calls and method names
>>>
>>>
>>> I don't understand this argument at all. So this guy is proposing that
>>> we change all the jQuery methods to:
>>>
>>> $Array([array of elems])
>>> $Selector("str")
>>> $HTML("html")
>>> $Element(DOMElement)
>>>
>>> and:
>>>
>>> .appendElement(DOMElement)
>>> .appendHTML("html")
>>> .appendArray([array of elems])
>>>
>>> what on earth does that gain you? What's the purpose of using a
>>> language that can overload arguments and not actually using that
>>> feature? What's the advantage of increasing the size of your API 4-fold?
>>>
>>> Incredibly weak argument, obviously someone who's never used the library.
>>>
>>>> Some method names make no
>>>> immediate sense, like .one or .eq, and you can't immediately tell if
>>>> a method acts on the first element in the collection or all of them.
>>>
>>> These arguments are slightly more valid. Although .eq() is going away
>>> in 1.2. I really don't know what to say, in this case it was simply a
>>> design decision. We could've had:
>>> .val() (return nothing, do nothing useful)
>>> .val("val") (set value)
>>> .getVal() (get value)
>>> .getVal("val") (return nothing, do nothing useful)
>>>
>>> But why have a state of a method perform nothing useful at all? Why
>>> not overload it to actually do something? Why double the size of the
>>> effective API with half-useful functions?
>>>
>>> --John
>>>
>>> On 8/16/07, Mitch <goofy167@...> wrote:
>>>>
>>>> What do you guys think of this critique of jQuery I found on Simon
>>>> Willison's site (which is good reading).
>>>>
>>>> http://simonwillison.net/2007/Aug/15/jquery/
>>>>
>>>> <quote>
>>>> jQuery is definitely a popular utility function library, but the
>>>> sheer amount of dual/triple/quadruple special-case uses for both
>>>> function calls and method names is an instant turnoff for me.
>>>>
>>>> The jQuery object itself can perform a selector query, embed a DOM
>>>> element, create a DOM element from HTML and assign a DOMContentReady
>>>> event handler - and probably more. Event handling is separated into
>>>> separate methods for each event type. Some method names make no
>>>> immediate sense, like .one or .eq, and you can't immediately tell if
>>>> a method acts on the first element in the collection or all of them.
>>>>
>>>> I can't recommend jQuery to the developers I am mentoring because it
>>>> is in itself a completely separate abstraction, and a muddy one at
>>>> that. They will end up having to learn jQuery instead of having to
>>>> learn DOM, CSS and JS, and when being considered as a direct
>>>> replacement for those it fails both due to complexity and
>>>> inconsistency."
>>>>
>>>> </quote>

>>>>
>>>> Mitch
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>


Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Jonathan Sharp-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 8/16/07, Stephan Beal <sgbeal@...> wrote:
On Aug 16, 7:39 pm, Mitch <goofy...@...> wrote:
*snip*
.... Simon Willison apparently has a
similar hang-up about jQuery. And, like i am in my hate-hate
relationship with Python, he's in the minority.
 
Minor detail, it wasn't Simon Willson who made that comment, it as Thor Larholm (http://larholm.com/about-2/)
 
I think one aspect of Thor's argument can be proved true with a grain of salt and that is learning jQuery isn't a replacement for learning JS/DOM for SOME people.
 
Two different situations to take into account:
1) Average j(an|o)e want's to spice up h(er|is) page and add a cool tabbed interface, a jQuery minute(TM) later and they're done 
2) Application developer is building an enterprise solution/product and utilizing jQuery. jQuery greatly speeds up development but underlying knowledge of JS/DOM is of the utmost importance.
 
Having come from a strong JS background prior to jQuery, jQuery doesn't replace my thought process in regards to the DOM, it enhances it taking development time from hours of tedius coding to a jQuery minute(TM). The knowledge of the "pure form" is (I'll go as far as to say) required. So I can see his argument for not having those he's mentoring learn it, but that doesn't mean he shouldn't use it. This can go back to the argument in CS majors of students complaining that they have to learn memory management/heaps/stacks/registeres/etc when Java doesn't use any of them. The thing that ends up distinguishing good from great programmers is their underlying knowledge of the abstraction layers they're using. Thus we're right back at Simon Wilson's argument for learning the underlying black box.
 
-js

http://jQueryMinute.com (my host is having some network problems...)

Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> http://jQueryMinute.com (my host is having some network problems...)

Oooh - new site! I'm excited :)

--John

Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Brandon Aaron :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Knowing how to do it without jQuery makes me appreciate jQuery that much more.

--
Brandon Aaron

On 8/16/07, Jonathan Sharp <jdsharp@...> wrote:
On 8/16/07, Stephan Beal <sgbeal@...> wrote:
On Aug 16, 7:39 pm, Mitch <goofy...@...> wrote:
*snip*
.... Simon Willison apparently has a
similar hang-up about jQuery. And, like i am in my hate-hate
relationship with Python, he's in the minority.
 
Minor detail, it wasn't Simon Willson who made that comment, it as Thor Larholm (http://larholm.com/about-2/ )
 
I think one aspect of Thor's argument can be proved true with a grain of salt and that is learning jQuery isn't a replacement for learning JS/DOM for SOME people.
 
Two different situations to take into account:
1) Average j(an|o)e want's to spice up h(er|is) page and add a cool tabbed interface, a jQuery minute(TM) later and they're done 
2) Application developer is building an enterprise solution/product and utilizing jQuery. jQuery greatly speeds up development but underlying knowledge of JS/DOM is of the utmost importance.
 
Having come from a strong JS background prior to jQuery, jQuery doesn't replace my thought process in regards to the DOM, it enhances it taking development time from hours of tedius coding to a jQuery minute(TM). The knowledge of the "pure form" is (I'll go as far as to say) required. So I can see his argument for not having those he's mentoring learn it, but that doesn't mean he shouldn't use it. This can go back to the argument in CS majors of students complaining that they have to learn memory management/heaps/stacks/registeres/etc when Java doesn't use any of them. The thing that ends up distinguishing good from great programmers is their underlying knowledge of the abstraction layers they're using. Thus we're right back at Simon Wilson's argument for learning the underlying black box.
 
-js

http://jQueryMinute.com (my host is having some network problems...)


Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by xwero :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




On Aug 16, 10:27 pm, "Glen Lipka" <g...@...> wrote:
> As a non-programmer, (HTML/CSS only) I understand lt() and gt() mainly
> because of < and >.
> I think those are very easy.  The place I get confused a little is when you
> can say $("p:gt(4)") and $("p").gt(4) and get the same thing.  Why both?  I
> suppose the answer is "because some people like it one way and some the
> other".
>

I believe John posted in another thread the methods are gone in future
releases and the selectors stay. So no more confusion for you :)

>
> Glen
>
> On 8/16/07, Rey Bango <r...@...> wrote:
>
>
>
> > Amazon.
>
> > Rey
>
> > Andy Matthews wrote:
> > > Karl...
>
> > > Where would be the best place for my company to purchase your book so
> > > that you will get the maximum benefit?
>
> > > ------------------------------------------------------------------------
> > > *From:* jquery-en@... [mailto:jquery-en@...]
> > > *On Behalf Of *Karl Swedberg
> > > *Sent:* Thursday, August 16, 2007 2:15 PM
> > > *To:* jquery-en@...
> > > *Subject:* [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > > special-case uses for both function calls and method names
>
> > > Andy,
>
> > > I realize these are contrived examples, but if you're interested in
> > > seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can
> > > be used for, here are a few links that might be helpful:
>
> >http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...
>
> >http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...
>
> > >http://book.learningjquery.com/3810_02_code/selectors.html
> > >http://book.learningjquery.com/3810_03_code/traversing.html
>
> > > --Karl
> > > _________________
> > > Karl Swedberg
> > >www.englishrules.com
> > >www.learningjquery.com
>
> > > On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:
>
> > >> John...
>
> > >> I should have added on to my OP. Better examples are really what is
> > >> needed,
> > >> not changes to the language. Let me read through and see possible RW
> > >> examples of eq() or is() and let me say "hey I did that very thing last
> > >> week, but with 10 more lines of code)".
>
> > >> andy
>
> > >> -----Original Message-----
> > >> From: jquery-en@... [mailto:jquery-en@...] On
> > >> Behalf Of John Resig
> > >> Sent: Thursday, August 16, 2007 1:48 PM
> > >> To: jquery-en@...
> > >> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > special-case
> > >> uses for both function calls and method names
>
> > >> Sure, that makes sense - and it's obviously difficult. I think the
> > burden
> > >> may lie on us to write better examples - although, it's hard to think
> > of
> > >> ones that aren't complex that also aren't contrived.
>
> > >> At this point, I look for fringe cases in jQuery where, simply, a
> > >> plugin is
> > >> unable to duplicate functionality (or where a plugin would be hugely
> > >> bloated, where the result in core would be quite simple, instead).
>
> > >> That being said, I'm still advancing the library with some fun methods
> > >> like
> > >> .andSelf() whose uses won't become commonly apparent until far down the
> > >> line.
>
> > >> --John
>
> > >> On 8/16/07, Andy Matthews <li...@...> wrote:
>
> > >>> John...
>
> > >>> To be fair...it's very easy to learn the basics of jQuery, but it's
> > >>> quite a lot of work and time to learn the really cool stuff. I've
> > >>> never used eq() or
> > >>> if() and those other because I simply don't understand what they do.
> > >>> I'm sure some of them could improve my code dramatically but I don't
> > >>> even know WHEN I might use them, so I don't know when to look for
> > >>> them. Does that makes sense?
>
> > >>> andy
>
> > >>> -----Original Message-----
> > >>> From: jquery-en@... [mailto:jquery-en@...]
> > >>> On Behalf Of John Resig
> > >>> Sent: Thursday, August 16, 2007 12:53 PM
> > >>> To: jquery-en@...
> > >>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > >>> special-case uses for both function calls and method names
>
> > >>> I don't understand this argument at all. So this guy is proposing that
> > >>> we change all the jQuery methods to:
>
> > >>> $Array([array of elems])
> > >>> $Selector("str")
> > >>> $HTML("html")
> > >>> $Element(DOMElement)
>
> > >>> and:
>
> > >>> .appendElement(DOMElement)
> > >>> .appendHTML("html")
> > >>> .appendArray([array of elems])
>
> > >>> what on earth does that gain you? What's the purpose of using a
> > >>> language that can overload arguments and not actually using that
> > >>> feature? What's the advantage of increasing the size of your API
> > 4-fold?
>
> > >>> Incredibly weak argument, obviously someone who's never used the
> > library.
>
> > >>>> Some method names make no
> > >>>> immediate sense, like .one or .eq, and you can't immediately tell if
> > >>>> a method acts on the first element in the collection or all of them.
>
> > >>> These arguments are slightly more valid. Although .eq() is going away
> > >>> in 1.2. I really don't know what to say, in this case it was simply a
> > >>> design decision. We could've had:
> > >>> .val() (return nothing, do nothing useful)
> > >>> .val("val") (set value)
> > >>> .getVal() (get value)
> > >>> .getVal("val") (return nothing, do nothing useful)
>
> > >>> But why have a state of a method perform nothing useful at all? Why
> > >>> not overload it to actually do something? Why double the size of the
> > >>> effective API with half-useful functions?
>
> > >>> --John
>
> > >>> On 8/16/07, Mitch <goofy...@...> wrote:
>
> > >>>> What do you guys think of this critique of jQuery I found on Simon
> > >>>> Willison's site (which is good reading).
>
> > >>>>http://simonwillison.net/2007/Aug/15/jquery/
>
> > >>>> <quote>
> > >>>> jQuery is definitely a popular utility function library, but the
> > >>>> sheer amount of dual/triple/quadruple special-case uses for both
> > >>>> function calls and method names is an instant turnoff for me.
>
> > >>>> The jQuery object itself can perform a selector query, embed a DOM
> > >>>> element, create a DOM element from HTML and assign a DOMContentReady
> > >>>> event handler - and probably more. Event handling is separated into
> > >>>> separate methods for each event type. Some method names make no
> > >>>> immediate sense, like .one or .eq, and you can't immediately tell if
> > >>>> a method acts on the first element in the collection or all of them.
>
> > >>>> I can't recommend jQuery to the developers I am mentoring because it
> > >>>> is in itself a completely separate abstraction, and a muddy one at
> > >>>> that. They will end up having to learn jQuery instead of having to
> > >>>> learn DOM, CSS and JS, and when being considered as a direct
> > >>>> replacement for those it fails both due to complexity and
> > >>>> inconsistency."
>
> > >>>> </quote>
>
> > >>>> Mitch


Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


It's fair to say that the documentation is a little thin on the
ground. I've been writing jQuery for a long while and I'd never even
heard of the if() or eq() functions, let alone lt() and gt(). Having
said that - what is there is generally very well written and and
covers alot. It is also very concise which is both good and bad.


On Aug 16, 11:43 pm, David Duymelinck <dlinc...@...> wrote:

> On Aug 16, 10:27 pm, "Glen Lipka" <g...@...> wrote:
>
> > As a non-programmer, (HTML/CSS only) I understand lt() and gt() mainly
> > because of < and >.
> > I think those are very easy.  The place I get confused a little is when you
> > can say $("p:gt(4)") and $("p").gt(4) and get the same thing.  Why both?  I
> > suppose the answer is "because some people like it one way and some the
> > otht ter".
>
> I believe John posted in another thread the methods are gone in future
> releases and the selectors stay. So no more confusion for you :)
>
>
>
> > Glen
>
> > On 8/16/07, Rey Bango <r...@...> wrote:
>
> > > Amazon.
>
> > > Rey
>
> > > Andy Matthews wrote:
> > > > Karl...
>
> > > > Where would be the best place for my company to purchase your book so
> > > > that you will get the maximum benefit?
>
> > > > ------------------------------------------------------------------------
> > > > *From:* jquery-en@... [mailto:jquery-en@...]
> > > > *On Behalf Of *Karl Swedberg
> > > > *Sent:* Thursday, August 16, 2007 2:15 PM
> > > > *To:* jquery-en@...
> > > > *Subject:* [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > > > special-case uses for both function calls and method names
>
> > > > Andy,
>
> > > > I realize these are contrived examples, but if you're interested in
> > > > seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can
> > > > be used for, here are a few links that might be helpful:
>
> > >http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...
>
> > >http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...
>
> > > >http://book.learningjquery.com/3810_02_code/selectors.html
> > > >http://book.learningjquery.com/3810_03_code/traversing.html
>
> > > > --Karl
> > > > _________________
> > > > Karl Swedberg
> > > >www.englishrules.com
> > > >www.learningjquery.com
>
> > > > On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:
>
> > > >> John...
>
> > > >> I should have added on to my OP. Better examples are really what is
> > > >> needed,
> > > >> not changes to the language. Let me read through and see possible RW
> > > >> examples of eq() or is() and let me say "hey I did that very thing last
> > > >> week, but with 10 more lines of code)".
>
> > > >> andy
>
> > > >> -----Original Message-----
> > > >> From: jquery-en@... [mailto:jquery-en@...] On
> > > >> Behalf Of John Resig
> > > >> Sent: Thursday, August 16, 2007 1:48 PM
> > > >> To: jquery-en@...
> > > >> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > > special-case
> > > >> uses for both function calls and method names
>
> > > >> Sure, that makes sense - and it's obviously difficult. I think the
> > > burden
> > > >> may lie on us to write better examples - although, it's hard to think
> > > of
> > > >> ones that aren't complex that also aren't contrived.
>
> > > >> At this point, I look for fringe cases in jQuery where, simply, a
> > > >> plugin is
> > > >> unable to duplicate functionality (or where a plugin would be hugely
> > > >> bloated, where the result in core would be quite simple, instead).
>
> > > >> That being said, I'm still advancing the library with some fun methods
> > > >> like
> > > >> .andSelf() whose uses won't become commonly apparent until far down the
> > > >> line.
>
> > > >> --John
>
> > > >> On 8/16/07, Andy Matthews <li...@...> wrote:
>
> > > >>> John...
>
> > > >>> To be fair...it's very easy to learn the basics of jQuery, but it's
> > > >>> quite a lot of work and time to learn the really cool stuff. I've
> > > >>> never used eq() or
> > > >>> if() and those other because I simply don't understand what they do.
> > > >>> I'm sure some of them could improve my code dramatically but I don't
> > > >>> even know WHEN I might use them, so I don't know when to look for
> > > >>> them. Does that makes sense?
>
> > > >>> andy
>
> > > >>> -----Original Message-----
> > > >>> From: jquery-en@... [mailto:jquery-en@...]
> > > >>> On Behalf Of John Resig
> > > >>> Sent: Thursday, August 16, 2007 12:53 PM
> > > >>> To: jquery-en@...
> > > >>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > > >>> special-case uses for both function calls and method names
>
> > > >>> I don't understand this argument at all. So this guy is proposing that
> > > >>> we change all the jQuery methods to:
>
> > > >>> $Array([array of elems])
> > > >>> $Selector("str")
> > > >>> $HTML("html")
> > > >>> $Element(DOMElement)
>
> > > >>> and:
>
> > > >>> .appendElement(DOMElement)
> > > >>> .appendHTML("html")
> > > >>> .appendArray([array of elems])
>
> > > >>> what on earth does that gain you? What's the purpose of using a
> > > >>> language that can overload arguments and not actually using that
> > > >>> feature? What's the advantage of increasing the size of your API
> > > 4-fold?
>
> > > >>> Incredibly weak argument, obviously someone who's never used the
> > > library.
>
> > > >>>> Some method names make no
> > > >>>> immediate sense, like .one or .eq, and you can't immediately tell if
> > > >>>> a method acts on the first element in the collection or all of them.
>
> > > >>> These arguments are slightly more valid. Although .eq() is going away
> > > >>> in 1.2. I really don't know what to say, in this case it was simply a
> > > >>> design decision. We could've had:
> > > >>> .val() (return nothing, do nothing useful)
> > > >>> .val("val") (set value)
> > > >>> .getVal() (get value)
> > > >>> .getVal("val") (return nothing, do nothing useful)
>
> > > >>> But why have a state of a method perform nothing useful at all? Why
> > > >>> not overload it to actually do something? Why double the size of the
> > > >>> effective API with half-useful functions?
>
> > > >>> --John
>
> > > >>> On 8/16/07, Mitch <goofy...@...> wrote:
>
> > > >>>> What do you guys think of this critique of jQuery I found on Simon
> > > >>>> Willison's site (which is good reading).
>
> > > >>>>http://simonwillison.net/2007/Aug/15/jquery/
>
> > > >>>> <quote>
> > > >>>> jQuery is definitely a popular utility function library, but the
> > > >>>> sheer amount of dual/triple/quadruple special-case uses for both
> > > >>>> function calls and method names is an instant turnoff for me.
>
> > > >>>> The jQuery object itself can perform a selector query, embed a DOM
> > > >>>> element, create a DOM element from HTML and assign a DOMContentReady
> > > >>>> event handler - and probably more. Event handling is separated into
> > > >>>> separate methods for each event type. Some method names make no
> > > >>>> immediate sense, like .one or .eq, and you can't immediately tell if
> > > >>>> a method acts on the first element in the collection or all of them.
>
> > > >>>> I can't recommend jQuery to the developers I am mentoring because it
> > > >>>> is in itself a completely separate abstraction, and a muddy one at
> > > >>>> that. They will end up having to learn jQuery instead of having to
> > > >>>> learn DOM, CSS and JS, and when being considered as a direct
> > > >>>> replacement for those it fails both due to complexity and
> > > >>>> inconsistency."
>
> > > >>>> </quote>
>
> > > >>>> Mitch


Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by Mitchell Waite-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I think this is a very stimulating topic - the responses have given me
a lot of insights to the frameworks of which jQuery belongs.

I see there are some big issues here that kind of scare me, the one
that stood out to me is the claim that jQurey is not for beginners who
don't know the DOM, CSS and JS.

I would contend that it is precisely the beginner that jQuery appeals
to.

Using myself as a test case - I came in knowing a little bit about JS,
a bit more about CSS and pretty much nothing about DOM..

I had tried to use JS and CSS to do some fancy interface work and
really got stuck in the complexities of JS. Then I found JQ and the
world rocked for me. Suddenly I could do amazing things with my GUIs.
Sure I had holes in my knowledge bank, and its shown in this mailing
list, but I think you will admit this is a pretty impressive interface
for a beginner to make:

http://www.whatbird.com/wwwroot/Components/Complete_Search_Tab.html

I have tons to learn but what a great and fun way to get started!

I do think there is one hole in the JQ web site and that is there are
not enough real life examples.

To that end I am putting together jQuery Cheat Sheet (TM) (C) How To.

I plan to make this available for everyone to contibute to. These two
How Tos are examples of the format I am proposing to begin with. If
anyone has any suggestions would love to hear them. If you have some
suggestions for How Tos let me know and I will try and create them. I
was thinking of making this into some kind of wiki like system where
it would allow poeple to create How Tos that ended up in this standard
format when formatted.

http://www.whatbird.com/wwwroot/Components/jQuery_How_Do_I_not.html

http://www.whatbird.com/wwwroot/Components/jQuery_How_Do_I_attr.html

The JQ web site and other sites do a great job on explaining the API
(even if most of the examples dont show up correclty in IE7) - whats
missing is the practical side of the package. Real world non verbose
examples of how to use the important features presented in a non
trival but lucid manner, with the key concepts listed for indexing as
well as the discussion is key to these working.

Mitch


Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Great work Mitch - if someone wants to beat me to you, you should move
this over to the wiki. I'll try to take a stab at it, if I can
remember.

--John

On 8/16/07, Mitch <goofy167@...> wrote:

>
> I think this is a very stimulating topic - the responses have given me
> a lot of insights to the frameworks of which jQuery belongs.
>
> I see there are some big issues here that kind of scare me, the one
> that stood out to me is the claim that jQurey is not for beginners who
> don't know the DOM, CSS and JS.
>
> I would contend that it is precisely the beginner that jQuery appeals
> to.
>
> Using myself as a test case - I came in knowing a little bit about JS,
> a bit more about CSS and pretty much nothing about DOM..
>
> I had tried to use JS and CSS to do some fancy interface work and
> really got stuck in the complexities of JS. Then I found JQ and the
> world rocked for me. Suddenly I could do amazing things with my GUIs.
> Sure I had holes in my knowledge bank, and its shown in this mailing
> list, but I think you will admit this is a pretty impressive interface
> for a beginner to make:
>
> http://www.whatbird.com/wwwroot/Components/Complete_Search_Tab.html
>
> I have tons to learn but what a great and fun way to get started!
>
> I do think there is one hole in the JQ web site and that is there are
> not enough real life examples.
>
> To that end I am putting together jQuery Cheat Sheet (TM) (C) How To.
>
> I plan to make this available for everyone to contibute to. These two
> How Tos are examples of the format I am proposing to begin with. If
> anyone has any suggestions would love to hear them. If you have some
> suggestions for How Tos let me know and I will try and create them. I
> was thinking of making this into some kind of wiki like system where
> it would allow poeple to create How Tos that ended up in this standard
> format when formatted.
>
> http://www.whatbird.com/wwwroot/Components/jQuery_How_Do_I_not.html
>
> http://www.whatbird.com/wwwroot/Components/jQuery_How_Do_I_attr.html
>
> The JQ web site and other sites do a great job on explaining the API
> (even if most of the examples dont show up correclty in IE7) - whats
> missing is the practical side of the package. Real world non verbose
> examples of how to use the important features presented in a non
> trival but lucid manner, with the key concepts listed for indexing as
> well as the discussion is key to these working.
>
> Mitch
>
>
< Prev | 1 - 2 | Next >