From: Hans-Georg Michna on
I just replaced an older version of jQuery with 1.4.2, which
promptly broke the page where it was used (
http://winhlp.com/wxnet.htm ).

In this case it was apparently not a browser incompatibility,
but an outright defect---the .contents() method, which worked
well in the earlier version, now produces nonsense.

Had to rewrite the affected part of the code in pure JavaScript,
and the whole story showed both the weakness and the strength of
jQuery. The pure JavaScript code is much longer and much harder
to understand than the jQuery one-liner it replaced.

I wish we could have a version of jQuery that worked well. There
is obviously a market for that.

This made me think about jQuery's basic method of always
wrapping a DOM element array. I think that's clever, because you
can always get the element itself by merely adding an index
expression. On the other hand it may be worth a thought to have
an extra wrapper for a single DOM element.

I think it would be even nicer if the jQuery object shadowed all
DOM properties and methods as well, perhaps just for the
single-element instance.

It seems pretty obvious why particularly beginners like jQuery.
Its way to express DOM manipulations is, no doubt, elegant and
easy to understand. Its inefficiency doesn't concern the
beginner at first.

I think it is time to write a new version of jQuery, a competing
product whose functional expressions are at least as elegant as
jQuery's, but which is leaner and works better. Good
documentation would also help. jQuery's is too superficial and
imprecise.

But at the rate jQuery is adopted and spreading that is unlikely
to happen.

Hans-Georg
From: Andrew Poulos on
On 19/03/2010 9:59 AM, Hans-Georg Michna wrote:

> I think it is time to write a new version of jQuery, a competing
> product whose functional expressions are at least as elegant as
> jQuery's, but which is leaner and works better. Good
> documentation would also help. jQuery's is too superficial and
> imprecise.

David Mark has a superior "product" called My Library
<url: http://www.cinsoft.net/mylib.html >

Andrew Poulos
From: RobG on
On Mar 19, 8:59 am, Hans-Georg Michna <hans-
georgNoEmailPle...(a)michna.com> wrote:
> I just replaced an older version of jQuery with 1.4.2, which
> promptly broke the page where it was used (http://winhlp.com/wxnet.htm).
>
> In this case it was apparently not a browser incompatibility,
> but an outright defect---the .contents() method, which worked
> well in the earlier version, now produces nonsense.

Which indicates that their regression testing is faulty.


> Had to rewrite the affected part of the code in pure JavaScript,
> and the whole story showed both the weakness and the strength of
> jQuery. The pure JavaScript code is much longer and much harder
> to understand than the jQuery one-liner it replaced.

But you should be comparing your function to the underlying jQuery
code, not the code that calls it. Did you try to fix it?

If you would like help with the code you wrote, post it along with a
brief statement of what you want it to do and you might find it can be
written more clearly and concisely. I doubt you will have anything as
convoluted and difficult to follow as the jQuery code it replaces.

According to the documentation:

| Given a jQuery object that represents a set of DOM elements,
| the .contents() method allows us to search through the
| immediate children of these elements in the DOM tree and
| construct a new jQuery object from the matching elements.
| The .contents() and .children() methods are similar, except
| that the former includes text nodes as well as HTML elements
| in the resulting jQuery object.

That doesn't sound particularly difficult to me. All HTML elements
implementing the Node interface have a childNodes property that is a
collection of its children, so you can simply create an array of the
children of the elements you want in the array.

The same function could filter out unwanted nodes.

> I wish we could have a version of jQuery that worked well.

Now that has gotta be a giant red rag to the David Mark bull!

> is obviously a market for that.
>
> This made me think about jQuery's basic method of always
> wrapping a DOM element array. I think that's clever, because you
> can always get the element itself by merely adding an index
> expression. On the other hand it may be worth a thought to have
> an extra wrapper for a single DOM element.

I think you should be posting on the jQuery forum.

[...]
> I think it is time to write a new version of jQuery, a competing
> product whose functional expressions are at least as elegant as
> jQuery's, but which is leaner and works better. Good
> documentation would also help. jQuery's is too superficial and
> imprecise.
>
> But at the rate jQuery is adopted and spreading that is unlikely
> to happen.

jQuery has a while to run yet, but it will be replaced in time. The
last of those horrendous MM_ scripts seem to have finally died out, it
too nearly a decade. Hopefully jQuery will either become the library
it should have been (doubtful, given its history), or be replaced by
something better.


--
Rob
From: Peter Michaux on
On Mar 18, 9:45 pm, RobG <rg...(a)iinet.net.au> wrote:

> The last of those horrendous MM_ scripts seem to have finally died out

Dream on! ;-)

Peter
From: Jonathan Fine on
Andrew Poulos wrote:
> On 19/03/2010 9:59 AM, Hans-Georg Michna wrote:
>
>> I think it is time to write a new version of jQuery, a competing
>> product whose functional expressions are at least as elegant as
>> jQuery's, but which is leaner and works better. Good
>> documentation would also help. jQuery's is too superficial and
>> imprecise.
>
> David Mark has a superior "product" called My Library
> <url: http://www.cinsoft.net/mylib.html >

I'm delighted to see that it is now available open source. (Maybe not
news to this group, but news to me.)

--
Jonathan
 |  Next  |  Last
Pages: 1 2 3 4 5 6 7
Prev: question of logic?
Next: SUBMIT and Request.QueryString("