to learn jQuery if already using prototype

L

liketofindoutwhy

I am learning more and more Prototype and Script.aculo.us and got the
Bungee book... and wonder if I should get some books on jQuery (jQuery
in Action, and Learning jQuery) and start learning about it too?

Once I saw a website comparing Prototype to Java and jQuery to Ruby...
but now that I read more and more about Prototype, it is said that
Prototype actually came from Ruby on Rails development and the creator
of Prototype created it with making Prototype work like Ruby in mind.
Is jQuery also like Ruby? Thanks so much for your help.
 
T

Thomas 'PointedEars' Lahn

liketofindoutwhy said:
I am learning more and more Prototype and Script.aculo.us and got the
Bungee book... and wonder if I should get some books on jQuery (jQuery
in Action, and Learning jQuery) and start learning about it too?
[...]

Prototype.js, and consequently everything based upon it, like
Script.aculo.us, is junk. The jQuery junk support forums are
elsewhere, too.


PointedEars
 
K

kangax

I am learning more and more Prototype and Script.aculo.us and got the
Bungee book... and wonder if I should get some books on jQuery (jQuery
in Action, and Learning jQuery) and start learning about it too?

Once I saw a website comparing Prototype to Java and jQuery to Ruby...
but now that I read more and more about Prototype, it is said that
Prototype actually came from Ruby on Rails development and the creator
of Prototype created it with making Prototype work like Ruby in mind.
Is jQuery also like Ruby? Thanks so much for your help.

Questions regarding prototype.js are better to be asked at
http://groups.google.com/group/rubyonrails-spinoffs

Best,
kangax
 
B

beegee

Once I saw a website comparing Prototype to Java and jQuery to Ruby...

In a very, very superficial way, yes but no, forget what I just said.
I can't make the connection (not having read the site). Ruby and
Javascript are dynamic languages. JQuery and Prototype would not be
possible if Javascript was a compiled language like Java. And I
personally think Ruby is a beautiful language whereas I haven't
experienced a library whose "use code" looks quite as ugly as JQuery.

As PointedEars said, they are both junk. If you insist on a library,
check out YUI which is a lot like Javascript.
 
T

Thomas 'PointedEars' Lahn

beegee said:
In a very, very superficial way, yes but no, forget what I just said.
I can't make the connection (not having read the site). Ruby and
Javascript are dynamic languages. JQuery and Prototype would not be
possible if Javascript was a compiled language like Java.

For that matter, at least JavaScript[tm] *is* a compiled language like Java.
Don't confuse prompt execution with no-compilation.
[...]
As PointedEars said, they are both junk. If you insist on a library,
check out YUI which is a lot like Javascript.

I think you miss the point. YUI is *supposedly* only "more like
'Javascript'" (whatever that might be) than Prototype or jQuery in the sense
that its developers *supposedly* knew enough about the programming languages
to unleash their full potential without having to resort to inefficient and
error-prone detours of inventing "classes" and "initializers" where there
are already prototypes and constructors.


PointedEars
 
L

liketofindoutwhy

liketofindoutwhy said:
I am learning more and more Prototype and Script.aculo.us and got the
Bungee book... and wonder if I should get some books on jQuery (jQuery
in Action, and Learning jQuery) and start learning about it too?
[...]

Prototype.js, and consequently everything based upon it, like
Script.aculo.us, is junk. The jQuery junk support forums are
elsewhere, too.

So you mean Prototype and jQuery are both junk? Can you give some
points as to why you think so? For example, how else would you pass a
call back function binding to the current scope, such as
processData.bind(this) ? I kind of like the arr.each(function(x)
{ ... }) or the arr.sort().uniq().join(" ") syntax.
 
T

Thomas 'PointedEars' Lahn

liketofindoutwhy said:
So you mean Prototype and jQuery are both junk? Can you give some
points as to why you think so?

I want popcorn.


PointedEars
 
H

humeniuc

Prototype.js, and consequently everything based upon it, like
Script.aculo.us, is junk. The jQuery junk support forums are
elsewhere, too.

PointedEars

The list of the ones who uses, and consider Prototype or jQuery is
good coded is long... very long.
Some famous users:

Apple(http://www.apple.com/) uses Prototype
Google code (http://code.google.com/) uses jQuery
NASA(http://www.nasa.gov/) uses Prototype
Mozilla Addons (http://addons.mozilla.org/) uses jQuery
CNN (betaversion http://beta.cnn.com/) uses Prototype

I think PointedEars is wrong. If he could do better than jQuery,
Prototype, or YUI, maybe he could make examples of his 'great' work.
But i think he could not.
 
T

Thomas 'PointedEars' Lahn

humeniuc said:
Prototype.js, and consequently everything based upon it, like
Script.aculo.us, is junk. The jQuery junk support forums are
elsewhere, too.
[...]

The list of the ones who uses, and consider Prototype or jQuery is
good coded is long... very long.
Some famous users:

Apple(http://www.apple.com/) uses Prototype
Google code (http://code.google.com/) uses jQuery
NASA(http://www.nasa.gov/) uses Prototype
Mozilla Addons (http://addons.mozilla.org/) uses jQuery
CNN (betaversion http://beta.cnn.com/) uses Prototype

So what? They all have made the wrong design decision. Whether source code
is good is not defined by those who use it but by the source code itself.

Yours is an "appeal to authority" fallacy, BTW.
I think PointedEars is wrong. If he could do better than jQuery,
Prototype, or YUI, maybe he could make examples of his 'great' work.
But i think he could not.

And an ad hominem fallacy in addition.


PointedEars
 
G

Gregor Kofler

humeniuc meinte:
The list of the ones who uses, and consider Prototype or jQuery is
good coded is long... very long.
Some famous users:

And I suppose equally groundbreaking when it comes to web authoring.

The website is HTML 4 *Transitional* - still issues several warnings.
YSlow rates it "F". Flexible layouts? Never heard of these.
Google code (http://code.google.com/) uses jQuery

More or less the same. Can't find jQuery in the scripts list, perhaps it
is included in another one.

As another one with pointed ears would have put it: "Fascinating".
Proprietary doctype. 48 warnings. Again: Layouting from the last century.
Starts with:

<script type="text/javascript">
/**
* Browser Detect Class (sic!)
*/
function detectBrowserClass(modern){
var nBrowser = navigator.appName;
var nVersion = navigator.appVersion;
var nAgent = navigator.userAgent;
this.version;
this.browser;
this.os;
this.modern = (typeof modern == 'object') == true ? modern:0;
if(nVersion.indexOf('Windows') !=-1){
this.os = 'win';
}else{
this.os = (nVersion.indexOf('Macintosh') !=-1) == true ? 'mac':'other';
}

Those guys definitely know, what they're doing... Apart from that
they've added around 400kB of various JS libraries. Seems as if
prototype isn't capable of anything.
CNN (betaversion http://beta.cnn.com/) uses Prototype

Super slow loading - about 50% of the 630kB payload is eaten up by JS
files...
I think PointedEars is wrong. If he could do better than jQuery,
Prototype, or YUI, maybe he could make examples of his 'great' work.

He frequently posts links to his "work". Anyway, I suppose since Richard
Cornford, Douglas Crockford, Randy Webb and others also question the
quality of these libraries frequently, they're clueless ignorants, too.


Gregor
 
V

VK

The website is HTML 4 *Transitional* - still issues several warnings.

So what? HTML 4 Transitional is the only usable doctype so far - until
HTML 5 will finally arrive. HTML 4 Strict is missing some vital
features like target attribute for links and iframe. Moreover HTML 4
Strict puts IE6 into W3C box model and it doesn't understand box-
sizing: border-box to switch it back to normal. So while IE6 is still
in consideration and while HTML 5 is not ready, HTML 4 Transitional is
the only one you can really work with.
Flexible layouts? Never heard of these.

Nor me. At least not a single one that could be trusted. The choice is
very simple here: do you want flexible (liquid) layout or do you want
another contract work?

Moreover any modern browser now supports Ctrl+/- magnifier, so the
need of flexible (liquid) layouts - which was a workaround for IE4/5/6
display augmentation weakness - is mostly over.
More or less the same. Can't find jQuery in the scripts list, perhaps it
is included in another one.

Look at the http://code.google.com page source itself. It loads
http://code.google.com/js/codesite.pack.01312008.js
which is jQuery 1.2.3
As another one with pointed ears would have put it: "Fascinating".
Proprietary doctype. 48 warnings. Again: Layouting from the last century.
Starts with:

<script type="text/javascript">
/**
* Browser Detect Class (sic!)
*/
function detectBrowserClass(modern){
var nBrowser = navigator.appName;
var nVersion = navigator.appVersion;
var nAgent = navigator.userAgent;
this.version;
this.browser;
this.os;
this.modern = (typeof modern == 'object') == true ? modern:0;
if(nVersion.indexOf('Windows') !=-1){
this.os = 'win';}else{

this.os = (nVersion.indexOf('Macintosh') !=-1) == true ? 'mac':'other';

}

Those guys definitely know, what they're doing... Apart from that
they've added around 400kB of various JS libraries. Seems as if
prototype isn't capable of anything.


NASA is a US governmental unit, their site is under FOIA and ADA
rules. Whatever they had to be done to not be sued they had to do. If
you are a US citizen - or you know one to help you - contact NASA at
http://www.nasa.gov/help/contact/index.html showing where and how the
site accessibility or usability is broken for you.
Super slow loading - about 50% of the 630kB payload is eaten up by JS
files...

It takes 3sec on my 4Mb/sec downstream DSL for the initial page
display where the download itself takes 0.39sec You may want to
consider switching from Dial-Up to something more speedy ;-)
 
H

humeniuc

Yours is an "appeal to authority" fallacy, BTW.
I am not an authority at all. I am just a developer. But I think I
have the right to an opinon. Prototype helped me in developement and
other found a help in jQuery.

"They all have made the wrong design decision."
From this afirmation, I could say you are with "appeal to authority".
If you sad that they made wrong descisions, show us some good
decision. Where did they made wrong decisions?
Invitation: post here some links of your works, so anybody could see
good code, better than Prototype or jQuery.
Could you, please?
---------------------

Gregor, I only wanted to point that many sites uses that libraryes.
Google code have an "/js/codesite.pack.01312008.js" -- minified
version of jQuery
He frequently posts links to his "work".

I haven't seen any work of this person, I will search deeply in his
archive, but until now all that I saw was a lot of sarcasm and acid
remarks, but maibe PointedEars is a great programmer, in which case
wee should see some great code or some urls with that work from
him. :) (eventualy....)

All my best
 
G

Gregor Kofler

humeniuc meinte:
Gregor, I only wanted to point that many sites uses that libraryes.
Google code have an "/js/codesite.pack.01312008.js" -- minified
version of jQuery

That's what I meant with "included in another one".
I haven't seen any work of this person, I will search deeply in his
archive, but until now all that I saw was a lot of sarcasm and acid
remarks, but maibe PointedEars is a great programmer, in which case
wee should see some great code or some urls with that work from
him. :) (eventualy....)

The discussion about the "quality" of jQuery et al pops up frequently.

Anyway, as I noted: Thomas is not the only one. You can search for
previous threads on this topic. You can search for the other names (and
their work; David Mark comes to my mind, too). You know how to use
search engines.

Anyway, the point that somebody has to show off his own work before
being allowed to critize others work, is a poor one. You don't have to
be a chef to rate something as tasty or not.

Gregor
 
H

humeniuc

Anyway, the point that somebody has to show off his own work before
being allowed to critize others work, is a poor one. You don't have to
be a chef to rate something as tasty or not.

I agree with you. I exagerated a little here, but i was a little
iritated about Tomas atitude and his acid posts, not only in this
topic.
I reached his site, I see that he is a good programmer, but his
atitude ....

about jQuery quality, can't make a statement, I have coleagues who use
it and are happy with it.
I prefer Prototype. I don't know what programing rules broke Prototype
developers (if you have some links, discutions, please share), but
works for me.

Sorry if I offended someone, and happy programming. In pure
Javascript, Prototype, jQuery, YUI or what suits :)

Good day to all.
 
G

Gregor Kofler

humeniuc meinte:
I agree with you. I exagerated a little here, but i was a little
iritated about Tomas atitude and his acid posts, not only in this
topic.
I reached his site, I see that he is a good programmer, but his
atitude ....

about jQuery quality, can't make a statement, I have coleagues who use
it and are happy with it.
I prefer Prototype. I don't know what programing rules broke Prototype
developers (if you have some links, discutions, please share), but
works for me.

Perhaps this one:
<http://groups.google.at/group/comp...._frm/thread/2072e63631688fc4/d63033d712a89e02>

Gregor
 
R

RobG


Or this one:

<URL:
http://groups.google.com.au/group/c...should+I+eschew+prototype.js#e88d79970736fe36
A salient quote from one of Richard Cornford's posts in that thread:

"The Prototype.js approach results in code that cannot be
expected to work in any more browsers than those in which
it has been demonstrated to 'work', and so cannot even be
expected to 'work' with the future versions of ... those
browsers. This cannot be a viable approach to creating
cross-browser code, and it does not."
 
V

VK

A salient quote from one of Richard Cornford's posts in that thread:

"The Prototype.js approach results in code that cannot be
expected to work in any more browsers than those in which
it has been demonstrated to 'work', and so cannot even be
expected to 'work' with the future versions of ... those
browsers. This cannot be a viable approach to creating
cross-browser code, and it does not."

The Richard Cornford's point of view was well expressed in this NG
many times. In his universe a program for MS-DOS has to seamlessly
migrate on 16bit GUI of any kind (not Windows only), then equally
seamlessly migrate to 32bit and 64bit GUI. Respectively when
programming in say MS-DOS the programmer has to foresee the whole
future line of OS development 10-20 years in advance. Any message of
the kind "This program requires ... to run" is a sign of a very bad
programming. I do respect personal philosophical schemes including
idealistic romanticism as well. Yet claiming it as a world-wide the
only correct programming pattern is Richard Cornford's personal choice
other have rights do no agree with.
 
R

Richard Cornford

In the end it would be more productive to learn javascript and browser
scripting, and then you make your own mind up.

Prototype.js, and consequently everything based upon it, like
Script.aculo.us, is junk. The jQuery junk support forums are
elsewhere, too.

So you mean Prototype and jQuery are both junk?

I didn't think that statement was ambiguous in any way.
Can you give some points as to why you think so?

That is probably going to come down to understanding.
For example, how else would you pass a
call back function binding to the current scope,

Do you know what that means? It reads like the usual parroting of the
(lamentably) common misconception(or mislabelling) that scope is in some
way related to the value of the - this - keyword in javascript. While in
javascript scope is lexical and so (mostly) determined by the (structure
of the) source code and the - this - value is determined by how
functions/methods are call, and determined at runtime.
such as processData.bind(this) ?

So it is the - this - value that concerns you, not scope at all.

But what sort of question are you asking? Javascript programmers know
what the - this - keyword will refer to at any point, and how to arrange
that the - this - keyword refers to specific objects when it is
necessary. You are not programming until you are in control of that sort
of thing.

As both of Prototype.js and JQuery are written in javascript it must be
possible to write javascript code that does anything and everything that
either are capable of.
I kind of like the arr.each(function(x)
{ ... })

But is "like" enough of a reason? I have seen some horrendously
inefficient uses of function expressions in - each - and - forEach -
methods (including inside the JQuery source code). They seem to
encourage it, at lest where the author had not understood the
implications of what they are doing.
or the arr.sort().uniq().join(" ") syntax.

That style of method chaining has been dogging javascript for years. It
is occasionally useful, but it does result in some very obscure source
code, which probably explains why I can think of no regular contributors
to this group who choose that style of coding.

And one of the consequences of the inherent obscurity of that style of
code is demonstrated in your example. It looks to me like the intention
of - uniq - would be to remove repetitious values from the array
(assuming the subject is an array) and it is unlikely that that method
has been written such that it benefits in any way from the array being
pre-sorted, but the sort method will almost certainly be more efficient
if any elements that are to be removed from the array are removed before
sorting.

Of course seeing and understanding the source code for those methods
would answer the question one way or the other.

But 'liking' superficial syntax and convenience methods are nowhere near
enough to mitigate for the observation (from the source code) that the
authors of those two libraries did not (and seemingly still do not)
understand javascript as a language or its application in browser
scripting.

Richard.
 
R

RobG

A salient quote from one of Richard Cornford's posts in that thread:
  "The Prototype.js approach results in code that cannot be
   expected to work in any more browsers than those in which
   it has been demonstrated to 'work', and so cannot even be
   expected to 'work' with the future versions of ... those
   browsers. This cannot be a viable approach to creating
   cross-browser code, and it does not."

The Richard Cornford's point of view was well expressed in this NG
many times. In his universe [... snip ...]

The snipped part your post utterly misrepresents Richard's often
expressed opinion. The funny thing is that only those familiar with
your posting style will have any idea what you were trying to say -
and they know enough about what you post to ignore it.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top