« Return to Thread: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names
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 RWexamples of eq() or is() and let me say "hey I did that very thing lastweek, but with 10 more lines of code)".andy-----Original Message-----From: jquery-en@... [mailto:jquery-en@...] OnBehalf Of John ResigSent: Thursday, August 16, 2007 1:48 PMTo: jquery-en@...Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-caseuses for both function calls and method namesSure, that makes sense - and it's obviously difficult. I think the burdenmay lie on us to write better examples - although, it's hard to think ofones that aren't complex that also aren't contrived.At this point, I look for fringe cases in jQuery where, simply, a plugin isunable to duplicate functionality (or where a plugin would be hugelybloated, 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 theline.--JohnOn 8/16/07, Andy Matthews <lists@...> wrote:John...To be fair...it's very easy to learn the basics of jQuery, but it'squite a lot of work and time to learn the really cool stuff. I'venever used eq() orif() 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'teven know WHEN I might use them, so I don't know when to look forthem. Does that makes sense?andy-----Original Message-----On Behalf Of John ResigSent: Thursday, August 16, 2007 12:53 PMTo: jquery-en@...Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruplespecial-case uses for both function calls and method namesI don't understand this argument at all. So this guy is proposing thatwe 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 alanguage that can overload arguments and not actually using thatfeature? 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 noimmediate sense, like .one or .eq, and you can't immediately tell ifa method acts on the first element in the collection or all of them.These arguments are slightly more valid. Although .eq() is going awayin 1.2. I really don't know what to say, in this case it was simply adesign 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? Whynot overload it to actually do something? Why double the size of theeffective API with half-useful functions?--JohnOn 8/16/07, Mitch <goofy167@...> wrote:What do you guys think of this critique of jQuery I found on SimonWillison's site (which is good reading).http://simonwillison.net/2007/Aug/15/jquery/<quote>jQuery is definitely a popular utility function library, but thesheer amount of dual/triple/quadruple special-case uses for bothfunction calls and method names is an instant turnoff for me.The jQuery object itself can perform a selector query, embed a DOMelement, create a DOM element from HTML and assign a DOMContentReadyevent handler - and probably more. Event handling is separated intoseparate methods for each event type. Some method names make noimmediate sense, like .one or .eq, and you can't immediately tell ifa 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 itis in itself a completely separate abstraction, and a muddy one atthat. They will end up having to learn jQuery instead of having tolearn DOM, CSS and JS, and when being considered as a directreplacement for those it fails both due to complexity andinconsistency."</quote>Mitch
« Return to Thread: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names
| Free Forum Powered by Nabble | Forum Help |