From: Matt Kruse on 23 Dec 2009 10:49 On Dec 23, 8:09 am, Hans-Georg Michna <hans- georgNoEmailPle...(a)michna.com> wrote: > When I propose a library to a client, they want to see something > well-known and widely used, and I have some understanding for > that. Since they cannot judge the thing itself, they have to > judge "by proxy". I have the same experience. Some clients have an "approved" list of 3rd-party libraries that may be used. Even if I wanted to use "My Library" instead of jQuery I couldn't. > I keep thinking about a partly or mostly compatible jQuery > replacement, something that would look superficially like > jQuery, but would work better under the hood. > The idea would be to point out jQuery's shortcomings, but at the > same time offer jQuery users a very simply upgrade path. The $ > name makes this particularly easy, as people would not have to > change their jQuery-based code. I have wanted this for a while. In fact, I own myjquery.com which was going to be for that purpose. But I have never done it. The main argument against this is that it's the jQuery _concepts_ and core API that are flawed. Not just some of its internal workings. The overloading of functions, in particular, is seen by many to be bad design. And if you want to replicate the flawed API, you're going to end up in the same traps that jQuery is criticized for to begin with. I think it would be good to strip down the API to be reasonable and offer less functionality than the default jQuery. Make it the selector engine (which I also find very useful) with some commonly-used core functionality on top of it. Remove half the methods and remove the overloading from the other half. A lot of existing jQuery code probably wouldn't work with the new library, but that wouldn't be the point. Instead, you'd have a better starting-point to work from, and a smaller learning curve to go to a leaner, faster, more robust library. Plugins would very likely not work, but that's a good thing. Almost all jQuery plugins are junk :) Matt Kruse
From: Matt Kruse on 23 Dec 2009 11:29 On Dec 23, 10:14 am, David Mark <dmark.cins...(a)gmail.com> wrote: > Are you not paying attention? Did you see that the selector engine is > just as screwed up as attr (in much the same way?) In a few cases, it may give wrong results. I have never encountered them. It's very useful for everything I've used it for. Grabbing groups of objects and doing some action on them is a common requirement, and I happen to like the $('grab stuff').doSomethingToAllItems() way of handling it. It's handy, concise, and easy to write. > > Plugins would very likely not > > work, but that's a good thing. Almost all jQuery plugins are junk :) > Of course they are. You can't dress up a pig. ;) Can you put lipstick on it? Matt Kruse
From: David Mark on 23 Dec 2009 11:14 On Dec 23, 10:49 am, Matt Kruse <m...(a)thekrusefamily.com> wrote: > On Dec 23, 8:09 am, Hans-Georg Michna <hans- > > georgNoEmailPle...(a)michna.com> wrote: > > When I propose a library to a client, they want to see something > > well-known and widely used, and I have some understanding for > > that. Since they cannot judge the thing itself, they have to > > judge "by proxy". > > I have the same experience. Some clients have an "approved" list of > 3rd-party libraries that may be used. Even if I wanted to use "My > Library" instead of jQuery I couldn't. > > > I keep thinking about a partly or mostly compatible jQuery > > replacement, something that would look superficially like > > jQuery, but would work better under the hood. > > The idea would be to point out jQuery's shortcomings, but at the > > same time offer jQuery users a very simply upgrade path. The $ > > name makes this particularly easy, as people would not have to > > change their jQuery-based code. > > I have wanted this for a while. In fact, I own myjquery.com which was > going to be for that purpose. But I have never done it. > > The main argument against this is that it's the jQuery _concepts_ and > core API that are flawed. Not just some of its internal workings. Yes. it is an infantile design (so no maturation is possible). > > The overloading of functions, in particular, is seen by many to be bad > design. For what should be obvious reasons. > And if you want to replicate the flawed API, you're going to > end up in the same traps that jQuery is criticized for to begin with. Exactly. What is this perverse fascination with the name "jQuery". It's mud at this point. > > I think it would be good to strip down the API to be reasonable and > offer less functionality than the default jQuery. There are already better alternatives (as you well know). > Make it the selector > engine (which I also find very useful) with some commonly-used core > functionality on top of it. Are you not paying attention? Did you see that the selector engine is just as screwed up as attr (in much the same way?) They have no idea how to fix any of it either. ;) > Remove half the methods and remove the > overloading from the other half. > > A lot of existing jQuery code probably wouldn't work with the new > library, but that wouldn't be the point. A lot of existing "jQuery code" doesn't work with jQuery. They shave more off with every upgrade. ;) > Instead, you'd have a better > starting-point to work from, and a smaller learning curve to go to a > leaner, faster, more robust library. What library would that be? :) > Plugins would very likely not > work, but that's a good thing. Almost all jQuery plugins are junk :) Of course they are. You can't dress up a pig. ;)
From: David Mark on 23 Dec 2009 11:40 Matt Kruse wrote: > On Dec 23, 10:14 am, David Mark <dmark.cins...(a)gmail.com> wrote: > > Are you not paying attention? Did you see that the selector engine is > > just as screwed up as attr (in much the same way?) > > In a few cases, it may give wrong results. Gee, which cases? You do realize you would never know about any such cases unless they were mentioned here? > I have never encountered > them. So programming for you is exploring other people's bad code? > It's very useful for everything I've used it for. :) > Grabbing > groups of objects and doing some action on them is a common > requirement, and I happen to like the > $('grab stuff').doSomethingToAllItems() > way of handling it. It's handy, concise, and easy to write. It's nothing. You sure as hell don't need jQuery to do that. > > > > Plugins would very likely not > > > work, but that's a good thing. Almost all jQuery plugins are junk :) > > Of course they are. You can't dress up a pig. ;) > > Can you put lipstick on it? You could, but it would still be a pig. ;)
From: Hans-Georg Michna on 23 Dec 2009 09:09
On Mon, 21 Dec 2009 10:25:24 -0800 (PST), David Mark wrote: >On Dec 21, 9:47�am, Hans-Georg Michna <hans- >georgNoEmailPle...(a)michna.com> wrote: >> On Mon, 21 Dec 2009 10:07:21 GMT, rf wrote: >> >"Hans-Georg Michna" <hans-georgNoEmailPle...(a)michna.com> wrote in message >> >news:v7hui5la535o3haa1uo53odlpch1jj27mj(a)4ax.com... >> >> I must admit that I like jQuery's functional notation very much. >> >> I wish I had a version of jQuery that also worked perfectly >> >> under the hood. >I told you where to find something similar. It's even got a $ if you >really want that. ;) Yes, I'm aware of that and had a good look at it. The problem is not with the actual quality of your program, which I cannot easily judge, but with questions of longevity of the library, commitment to updating it as required, etc. When I propose a library to a client, they want to see something well-known and widely used, and I have some understanding for that. Since they cannot judge the thing itself, they have to judge "by proxy". >> >So why don't you write your own scripting language? >> Have to make a living. (:-) >With jQuery? That cycle is at the end. I meant that writing my own JavaScript library would take too much time without yielding any income. Whether I use jQuery or something else or only my own code is another question. I keep thinking about a partly or mostly compatible jQuery replacement, something that would look superficially like jQuery, but would work better under the hood. The idea would be to point out jQuery's shortcomings, but at the same time offer jQuery users a very simply upgrade path. The $ name makes this particularly easy, as people would not have to change their jQuery-based code. How about putting such a jQuery compatibility layer over your library? You could augment the methods or offer additional methods, for example in lieu of jQuery's .attr(...) method. You'd have to support .attr(...) for compatibility, perhaps with a clearer definition of what it is supposed to do, but you could offer better methods side by side. People could easily test this by swapping jQuery for the replacement and retesting their web sites. If word made the rounds that there is something like a better jQuery, success would be conceivable. Hans-Georg |