« Return to Thread: Share with CakePHP´s community

JQuery and Prototype [was Re: Share with CakePHP´s community]

by John David Anderson (_psychic_) :: Rate this Message:

Reply to Author | View in Thread



On Dec 11, 2006, at 2:45 PM, Felix Geisendörfer wrote:

> Hi Langdon,
>
>> JQuery looks good (powerful).  I have not come across it before,  
>> so am
>> on the learning curve.  Do you use it instead of Scriptaculous and
>> Prototype?
> Oh definitely! I've not touched Prototype/Scriptaculous since  
> somebody mentioned jQuery to me. There is nothing wrong with them,  
> and both of those libraries have brought a lot of good things to  
> the universe, but jQuery is a couple steps above on the  
> evolutionary ladder of JS code.

How so? I've heard good news about jQuery, but why do people like it  
better (besides footprint)?

> My own experience was that when I first converted one of my  
> projects from prototype to jQuery, I instantly cut my current JS  
> code in half. This was before I really knew most of what jQuery  
> could do. Now the JS code of this project is probably 1/4th or  
> 1/5th of it's original size.

Maybe that's just lines. The main thing I don't like about JQuery is  
ThatMany.linesOfCode(endup).lookingLikeA(TrainWreck);

> Or to express it with the a quote from a recent discussion on the  
> jQuery mailing list:
> Dave Methvin wrote:
>> > "You start with 10 lines of jQuery that would have been 20 lines of
>> > tedious DOM Javascript. By the time you are done it's down to  
>> two or
>> > three lines and it couldn't get any shorter unless it read your  
>> mind."

I that's partly due to the train-wrecked-ness of the library.  
Prototype isn't overly verbose - most calls to that (or  
scriptaculous) are one liners in my experience. Sure there's times  
when you want to chain things or queue events...

Well, there's that, and Prototype usage isn't much like vanilla DOM  
scripting.

> Using jQuery has had a hugely positive effect on my JS coding. But  
> more then that, it actually changed my attitude towards the  
> language itself. Before jQuery I thought Javascript was doomed to  
> produce ugly spaghetti code, and even the cool ajax stuff wouldn't  
> change that. Well now I actually really started to like the  
> language and have learned a lot more about it and it's been great fun.

Examples? I'm interested in learning more.

-- John
--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

 « Return to Thread: Share with CakePHP´s community