jquery vs dojo vs yui etc

T

Tim Streater

David Mark said:
[stuff]

After all these posts, I'm none the wiser: what is the problem these
libraries are trying to solve?

That's the problem. They are trying to solve everything for
everybody. Doesn't make sense for scripts that must be downloaded,
does it?

One big "issue" is cross-browser compatibility, which most "solve" by
peering at browsers endlessly and then adding browser sniffs to their
code. They then declare the scripts to be compatible with library X,
Y and Z (current versions only). When the next slew of major browsers
emerge, they go through it all again. That means more downloads for
the developers, more testing and ultimately more downloads (and forced
browser upgrades) for the hapless end-users.

None of it makes any sense, does it? :)

Just as well that what I'm doing involves one browser and one platform.
So I can stick to JavaScript and not worry about it.
 
J

John G Harris

On Thu, 17 Jun 2010 at 09:46:25, in comp.lang.javascript, VK wrote:

Do not Reinvent the Wheel
<snip>

Reasons for reinventing the wheel :

1 Because lorry tyres are too heavy for bicycles.
2 Because wire frame wheels are too fragile for lorries.
3 Because wire frame wheels were very right for aeroplanes in 1910 (see
any good museum) but no good for jumbo jets.
4 Because wheels are no use for mud; use tracks instead.
5 Because vehicle wheels are far too big and expensive for supermarket
trolleys.

In other words, "Do not Reinvent the Wheel" is more often than not a
substitute for thinking.

John
 
V

VK

Reasons for reinventing the wheel :

1 Because lorry tyres are too heavy for bicycles.
2 Because wire frame wheels are too fragile for lorries.
3 Because wire frame wheels were very right for aeroplanes in 1910 (see
any good museum) but no good for jumbo jets.
4 Because wheels are no use for mud; use tracks instead.
5 Because vehicle wheels are far too big and expensive for supermarket
trolleys.

In other words, "Do not Reinvent the Wheel" is more often than not a
substitute for thinking.

It is not what reinventing the wheel means in the context which should
be clear from the quotation as given. People don't need to sit on a
wheel for now on, but: people don't need to find another equiradial
shape just because the wheel is already taken.
 
K

Kenneth Tilton

Joe said:
Kenneth said:
It's a general purpose language like any other, so you can use it for
anything.

Can I download a compiler and use it to create .exe[cutable] files to
run on Windows? Can I use it to build web plugins? Can I embed it into
web pages? Can I use it to write an abstraction layer to display 3D
graphics? I don't think it can do any of these things although I could
be wrong.

Aside from the stuff that requires browser support*, yes, you could be
wrong. Of course you might not be aware that Lisp can call C and be
called back from C.

* If you don't think you are doing Lisp when you are doing JS, you could
be wrong again.
Things that people want to do ?


Actually quite the opposite. I don't want any JS libraries. They always
offer bloat no matter how well they're written. They always want to do
more than I need. I prefer to write my own code and when appropriate
re-use things I've written before (or someone else has shared on the
web). When I recently had to do some Ajax stuff, I found it a lot easier
writing my own 10-line function than learning how to use something like
jQuery.

I too like to roll my own wherever possible.

kt
 
V

VK

Aside from the stuff that requires browser support*, yes, you could be
wrong. Of course you might not be aware that Lisp can call C and be
called back from C.

In my career I had to extend and to adjust some AutoLISP for AutoCAD
http://en.wikipedia.org/wiki/AutoLISP
and I dare to tell that I never had anything more contre-OOP and
contre-instinctive ever since Sinclair Basic
http://en.wikipedia.org/wiki/Sinclair_BASIC
or *even* before it: but again I might be missing the appropriate mind
set - still my first aim was out to the VBA higher level asap and
where to solve the posed problems. Again, it is a purely personal
experience.
 
T

Tim Streater

Matt Kruse said:
After all these posts, I'm none the wiser: what is the problem these
libraries are trying to solve?

The goal of any library/framework/layer/abstraction is to simplify the
solution to one problem, so it can be used as a foundation for solving
a bigger problem.
[snip]

JS Libraries, as a way to abstract away the problems with browser
scripting, may not be the *best* solution. But it is one solution, and
it works very well for many people. I think it's great to argue for
different ways to abstract away the problem, and pick the option that
is best. But IMO, rejecting the abstraction altogether because of its
shortcomings is short-sighted. Web development will move on without
these detractors. Libraries will be used and improved, because people
don't want to have to deal with the whole nasty, confusing browser
scripting layer. They want it solved, at least to a degree that they
are comfortable with, and presented in a nicer, easier-to-use form.
That's what libraries like jQuery do, and that's why people so
overwhelmingly choose to use them.

Mmm, thanks. The concept is clear, I'm not sure whether I buy the
argument. To me, JavaScript is a simple enough language that I have no
problems using it. But then I'm a programmer. Ten years ago a guy in our
group came to me and said "I'm leaving, you get this project now" and
gave me a 30 minutes intro to HTML, JavaScript, PHP, and mysql, of which
I'd heard something about the first and the last, and knew nothing at
all about the middle two (not even the names). Luckily the most recent
language I'd used (ten years before *that*, I'd moved into networking in
the interim) was C, so it wasn't too hard. Everything else I've picked
up from the web, text books, and occasional loitering around NGs.

I've had a brief look at JScript, looks harder than JavaScript to me.
 
G

Gregor Kofler

Am 2010-06-17 19:50, Joe Nine meinte:
Gregor said:
Am 2010-06-17 16:21, David Mark meinte:
On Jun 17, 9:21 am, Kenneth Tilton<[email protected]> wrote:

[qooxdoo rocks - as usual]
In short, it's a bad library.

Hmm, do I see your softer side here? ;-)

A library which replaces and rebuilds all kind of (form) elements with
custom lookalikes (but not behavealikes) is crap. Axiomatically - no
matter whether the code is of utmost quality.

Admit it, you've been waiting for weeks for a thread where you can use
the word axiomatically :)

Indeed. Glad it finally happened.
 
G

Garrett Smith

Yes, I misunderstood what you were aiming at.


The master branch at github was last updated 2010-02-18, the latest release
(2.2) was uploaded 2009-11-28. So it might be time for another review.


That hasn't changed, but I do not consider it a problem in itself. I have a
source code editor to view and edit the source if it turns out to be
erroneous. What I have a problem with is that the test site of JsUnit 2.2
is apparently not scrollable in Firefox (so I need full screen), but that
could be remedied.


There is a Stop button, so that appears to have changed in the meanwhile.

That actually sounds familiar. However, I do not recall useful stop
functionality.
It can only be as good as what the ECMAScript implementation provides. I
think they are doing not bad there. I could even reuse their approach in
providing a stack trace along with my exceptions.


That appears to have changed.


How do you propose that to be implemented?

wait and waitForCondition can each use setTimeout.

The test that fires oncomplete when all deferred segments are done and
to know when that happens, it subscribes to the "oncomplete" of each
segment.

This means that tests may complete out of order.

A test is part of a tree structure and has a testableList of deferred
segments (possibly 0 length). A deferred segment is also a Test and when
a deferred segment calls wait, then the deferred segment gets an item in
its testableList; it won't fire oncomplete until is not done.

TestRunner is the root node of the tree. TestRunner can have tests and
suites, but the caller doesn't actually have to create formal
structures, the caller can just add things to the TestRunner.

I explained a little recently in MessageID:
[email protected]

It's a little sloppy right now; I've got some rough spots in it.
Which alternatives to JsUnit are you recommending?

The most relevant I found at the time I was searching was YUI Test

I've run into too many problems with that. Starting with the author
takes a long time to fix bugs (1 year+). Getting free contributions
accepted to YUI requires you to sign legal documentation that I don't
want to sign.

I have had to patch many things in it, such as relatedTarget not working
properly. The source code shows the problems in code comments and the
author shows how he did not solve them.

/*
* Check to see if relatedTarget has been assigned. Firefox
* versions less than 2.0 don't allow it to be assigned via
* initMouseEvent() and the property is readonly after event
* creation, so in order to keep YAHOO.util.getRelatedTarget()
* working, assign to the IE proprietary toElement property
* for mouseout event and fromElement property for mouseover
* event.
*/
if (relatedTarget && !customEvent.relatedTarget){
if (type == "mouseout"){
customEvent.toElement = relatedTarget;
} else if (type == "mouseover"){
customEvent.fromElement = relatedTarget;
}
}

You can see the test function is tied to the code that is being tested.
The author's comment "in order to keep YAHOO.util.getRelatedTarget()
working, assign to the IE proprietary toElement property"

Mentioning problems to the author is a waste of time; he just either
ignores email or won't fix the bugs.

http://sourceforge.net/tracker/?func=detail&atid=836476&aid=1889966&group_id=165715

Got fixed. Other bugs that didn't were the event simulation req for
Apple Touch Events. I submitted a patch and the reply I got was "please
sign these legal documents so we can use your code for free.". Wow, what
a great way to show appreciation. No thanks, I'll just patch where I
need to and forget about submitting bugs in the future.

The debugging issues in YUI Test are painful. Each dispatched event
calls a very long function -- around one hundred statements or so.
This is a problem when you want to step from dispatching the event
through to the callback.

Given an element "myTargetObject" with a mousedown event handler, the
following test would dispatch that event and then afterwords, the
condition of `a` could be checked. Synth events are not always the same,
so sometimes you want to step into with debugger to see what actually
happens. For example:

testMyEvent : function() {
debugger; // Click 'step over' 47 times after this
Action.mousedown(myTargetObject);
Assert.isTrue(myTargetObject.a, msg);
}

After explaining to the author how to refactor that, he brushed off the
possibility and claimed that the functions must be long and then ignored
all subsequent emails. So again, I wasted time to try to help but got no
appreciation for it. I get the sense that it is more of a public image
type of thing with the author.

I also found that focus and blur events were not implemented, but needed
to be for some cases; that is: Where `focus()` on particular object
would not work for that given case. I can't remember why, maybe it had
to do with onfocusin -- I forgot. I added support for focus and blur
events (which also fire onfocusin and onfocusout).

Other frustrations are the inability to rerun just one particular test
function.

In 2007, I found that YUI Test was attractive. The limitations have
become so burdensome that it is time to move on.

Garrett
 
K

Kenneth Tilton

VK said:
In my career I had to extend and to adjust some AutoLISP for AutoCAD
http://en.wikipedia.org/wiki/AutoLISP

What has an AutoCAD embedded language got to do with Lisp?

Please do not answer "the sequence l, i, s, and p.". Hint.
and I dare to tell that I never had anything more contre-OOP and
contre-instinctive ever since Sinclair Basic
http://en.wikipedia.org/wiki/Sinclair_BASIC
or *even* before it: but again I might be missing the appropriate mind
set - still my first aim was out to the VBA higher level asap and
where to solve the posed problems. Again, it is a purely personal
experience.

Of AutoCAD. Of Lisp you know nothing.

hth, kt
 
G

Garrett Smith

On 18/06/10 01:43, Garrett Smith wrote: [...]


That said, I was in a similar situation as you, twice. Both times I
decided it wasn't worth the hassle to sign and send back their
documents, and in the end didn't submit the patches. So yes, I agree
that the legal safeguards can be a huge motivational hurdle for
potential submitters.

It's not just that. I'm trying to help - FOR FREE - and don't want to be
asked to go through the extra effort to sign legal obstacles to satisfy
some corporate lawyers.

The author can copy the code I wrote, and change it as I suggested, and,
for extra-credit, try and improve on it.

http://yuilibrary.com/projects/yui2/ticket/2528514

Opened last September and I'll bet you that uneaten kipferl that it'll
sit there for at least another 5 months.

This one has been in cue for two years!
http://yuilibrary.com/projects/yui2/ticket/1924108
(yes I'm the reporter there, too).

It might seem like I've got beef with the author -- well, in addition to
the unfixed bugs, ignored emails, yes, I do.

I'm going to make a post about that.

Garrett
 
B

Bwig Zomberi

Joe said:
I know. I imagine everyone here does.


I learned that in class too. I don't see the relevance to anything though.


I doubt anyone thinks it has any relation to unix.

Good to know that you know. Then why imply Unix/Linux users should be
the ones to like jQuery, when those guys would mostly prefer C or C-like
languages. Classic syntax is a mainstay of many Unix-origin languages -
it is not a Windows-only trait. Difficult syntax is not alien to Windows
- Hungarian notation used in VC++ for example.
 
B

Bwig Zomberi

Tim said:
[stuff]

After all these posts, I'm none the wiser: what is the problem these
libraries are trying to solve?

A single and smaller codebase for users to implement special effects if
sites like Smashing Magazine are to be believed. The libraries are
expected to do the heavy lifting and fix browser issues.

Libraries also seem to provide shorthand for JavaScript. I never got
tired of using document.getElementById or DOM array parsing. In fact, I
feel safe with it.
 
T

Thomas 'PointedEars' Lahn

Garrett said:
Thomas said:
Garrett said:
Thomas 'PointedEars' Lahn wrote:
Garrett Smith wrote:
I've looked for, but found no unit tests. If I'm going to use
something, I want to run tests on it to verify the edge cases.
What's wrong with JsUnit?<http://www.jsunit.net/>
[...]
* No asynchronous testing features.
How do you propose that to be implemented?

wait and waitForCondition can each use setTimeout.
[...]
I explained a little recently in MessageID:
[email protected]
Thanks.
Which alternatives to JsUnit are you recommending?

The most relevant I found at the time I was searching was YUI Test

I've run into too many problems with that. [...]
In 2007, I found that YUI Test was attractive. The limitations have
become so burdensome that it is time to move on.

This reads to me as if you are saying that you do not like several aspects
of JsUnit, but you do not know anything that is better. Would it not be a
good idea to help improve JsUnit then?

Please trim your quotes to the relevant minimum.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Tim said:
Matt said:
Tim said:
After all these posts, I'm none the wiser: what is the problem these
libraries are trying to solve?

The goal of any library/framework/layer/abstraction is to simplify the
solution to one problem, so it can be used as a foundation for solving
a bigger problem.
[snip]

JS Libraries, as a way to abstract away the problems with browser
scripting, may not be the *best* solution. But it is one solution, and
it works very well for many people. I think it's great to argue for
different ways to abstract away the problem, and pick the option that
is best. But IMO, rejecting the abstraction altogether because of its
shortcomings is short-sighted. Web development will move on without
these detractors. Libraries will be used and improved, because people
don't want to have to deal with the whole nasty, confusing browser
scripting layer. They want it solved, at least to a degree that they
are comfortable with, and presented in a nicer, easier-to-use form.
That's what libraries like jQuery do, and that's why people so
overwhelmingly choose to use them.

Mmm, thanks. The concept is clear, I'm not sure whether I buy the
argument.

Add me. Matt is still not getting that (JS) libraries as a concept are not
the issue, but the people writing them.

If those are clueful, experienced individuals, the library can grow
naturally from practice, evolutional from the general case to the special
one so that one reliable abstraction layer is placed upon another *when
necessary*, and it can become useful for both a single project and several
projects, both for the original authors and other people.

If instead the individual or group of authors are actually clueless
newcomers in the field and/or people with delusions of grandeur, who like to
present themselves as gurus, ninjas, and the like to begin with, the library
they will be writing will end up being bloated, unmaintainable code that
attempts to solve problems that did not need a solution in the first place.
It must fail badly at doing so, and it will create more problems than it
claims to solve. It only takes a few equally unexperienced and naive people
to use it and, from superficial testing, advocate using it to other equally
unexperienced/naive people for it to become a hype, even a cult, then. The
evidence for this can hardly be ignored.
I've had a brief look at JScript, looks harder than JavaScript to me.

How so? You are involuntarily writing JScript if you are writing
"JavaScript"/"Javascript"/"javascript" for IE/MSHTML, so it can't
be that hard to do.


PointedEars
 
M

Matt Kruse

Matt is still not getting that (JS) libraries as a concept are not
the issue, but the people writing them.

Umm, that's not at all what the mantra has been in here for years.
Over and over and over it has been said by many that general-purpose
javascript libraries are a bad idea.

My point has always been that general-purpose js libraries are a
_must_, and if the people with the skill to write them correctly don't
do so, then someone else will. And other people have. jQuery has lots
of problems. The coding of it and its design and the way the authors
attack problems are all quite poor. But it fills a need.

Even when someone like DM comes along and writes "His Library", he's
missing the point. He may get the technical aspects more correct, but
he lacks the vision and social grace required to make the library
actually useful to most developers. It's like he's created a better
mousetrap, but completely drops the ball on manufacturing, marketing,
and distribution. Whereas something like jQuery suffers from poor
quality, but gets the other stuff right.

Turn on any infomercial and see how ridiculous the product is, yet see
how many people buy it and how rich the creators are. It doesn't
matter how great of a product you create if you can't get it out to
the masses! And if the masses are creating terrible web sites full of
broken script, and this is the problem that DM is trying to address,
then he's doing it wrong. Even though it seems to drive DM crazy, the
truth is that John Resig is a much better salesman, and his product is
beating the pants of DM's "higher quality" product.

I still believe that the way to combat jQuery and to help fix all the
junk that it has spewed on the web is to create a library with a
compatible subset of the jQuery API, and implement it correctly. Then
people can switch over to it easily and comfortably, and get the
benefit of more robust code.

Matt Kruse
 
M

Matt Kruse

To me, JavaScript is a simple enough language that I have no
problems using it.

Perhaps you just haven't been exposed to all the cross-browser issues
yet? There are tons of quirks, bugs, non-standard behaviors, etc that
you must deal with if you write cross-browser scripts for the web,
where just about any browser may be used.
But then I'm a programmer.

Aren't most of us here? I've been using javascript since the day it
was released to the public. It still frustrates me sometimes. The
browser implementations, at least. Not so much the language itself.
I've had a brief look at JScript, looks harder than JavaScript to me.

Hmmm, I'm not sure what this statement really means.

Matt Kruse
 
T

Thomas 'PointedEars' Lahn

Matt said:
Thomas said:
Matt is still not getting that (JS) libraries as a concept are not
the issue, but the people writing them.

Umm, that's not at all what the mantra has been in here for years.
[...]

Yes, it has, and it has been pointed out to you before, even in this thread.
Unfortunately, you have not been paying attention.


HTH

PointedEars
 
T

Thomas 'PointedEars' Lahn

Matt said:
Perhaps you just haven't been exposed to all the cross-browser issues
yet? There are tons of quirks, bugs, non-standard behaviors, etc that
you must deal with if you write cross-browser scripts for the web,
where just about any browser may be used.

Cross-browser issues have nothing to do with the programming language.


PointedEars
 
M

Matt Kruse

Cross-browser issues have nothing to do with the programming language.

Duh. But the discussion is about general-purpose libraries, whose main
purpose is to smooth over cross-browser issues and add functionality
for web scripting.

Matt Kruse
 
T

Thomas 'PointedEars' Lahn

Johannes said:
Thomas 'PointedEars' Lahn :

That, exactly, is what bothers me in those discussions : the issue seems
to be *the people* writing those libraries. Technical objections alone
would hardly justify personal smears.

This has (as for me) nothing to do with personal smears. Source code is
written by people, and their knowledge, experience, and personalities define
the quality of the code they can produce. For example, you cannot
reasonably deny that if John Resig's delusions of grandeur would not get in
the way, if he would consider reading peer reviews, in time he could be
writing better code.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,078
Messages
2,570,570
Members
47,204
Latest member
MalorieSte

Latest Threads

Top