/    Sign up×
Community /Pin to ProfileBookmark

Prototype, Mootools and JQuery, OH MY!

So, I’m finally at least *thinking* about frameworks and their usefulness, or lack thereof, for $foo.

I’ve got an inherited site that apparently was written by a Prototype lover(?), well, at any rate, it *uses* Prototype, Scriptaculous and a tad bit of YUI, near as I can tell (several hands have been in the pot) and I’ve been looking at JQuery in order to add autocomplete support to a fairly decent local search engine.

My JS foo is pretty limited, mostly because I learned PHP first and have done most of the heavy lifting on the server side. I think I understand *why* to use a framework … (who has time to reinvent wheels when you can buy a car just down the street) … but what are the pros/cons of each, how difficult is it to switch a live site from one to the other, and which should it be?

I apologize if this is tantamount to flamewar fodder — that’s not my intent. I just need to get up to speed, and would appreciate your thoughts and pointers to favorite resources that might help me decide on the direction I should take.

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Apr 26.2011 — If you don't know much JavaScript, and don't have much interest in improving performance (for whatever reason), I would then stick with whatever legacy code you have and try to stick with whatever library is being used. While in an ideal world, you could rewrite the whole thing far more efficiently on your own (with a bit of practice if your JavaScript isn't great), that's time-consuming, and difficult to implement on a live site. To be honest, switching library is pretty much tantamount to a full re-write, and the benefits are extremely minimal.

In summary, if you were switching library, I would switch to jQuery. Prototype is probably the worst library in existance, so anything would be better. The ideal would be a custom built solution tailored to the site. If you are going to seriously rewrite it to jQuery, you might as well go the whole way and write a nice lean clean script. However, this might be impractical due to your knowledge (only you know that), and if it is, then you should probably go to jQuery.

I know I've sat on the fence, but I feel this is more practical. The best is not often the most practical, and while improved JavaScript performance is always good no matter how slight, sometimes, depending on the job, it's sometimes easier to just accept slightly substandard performance. However, if possible, if you use a library or not, I'd suggest that you learn enough JavaScript to be able to implement nearly everything on your own if you had to. Such knowledge is very handy from a development point of view, and helps you avoid a leaky abstraction.
Copy linkTweet thisAlerts:
@dalecospauthorApr 27.2011 — Thanks for the reply, Declan.However, if possible, if you use a library or not, I'd suggest that you learn enough JavaScript to be able to implement nearly everything on your own if you had to. Such knowledge is very handy from a development point of view, and helps you avoid a leaky abstraction.[/QUOTE]The site isn't heavily slanted towards JS functionality, so it's possible I could do it. I've done a few nice things in JS for the sake of learning, or what proved to be *afterward* only for the sake of learning ("Nah, we're not gonna need that functionality now..." ? )

The main issue I have is I feel like it takes so long for *me* to write good JS, and management makes it seem like every second we wait the company is going down the drain ?

Considering in this case it's a fairly simple AJAX request, I might be able to replace Prototype without much fallout.
Copy linkTweet thisAlerts:
@rproctor83Apr 27.2011 — jquery all the way. its lightweight, simple to use, cross browser supprt, giant community with a huge plug-in repository, uts light weight and for extended functionality there is jQuer UI. i use jquery on just about all mydev sites and it has been spectacular.
Copy linkTweet thisAlerts:
@dalecospauthorMay 01.2012 — OK, thanks for the reply. I have a basic autocomplete working using JQuery, but it doesn't work if I type more than one word; e.g. "agriculture" completes along just fine, but "agriculture in" and it stops following the typing.

Any thoughts on why this might occur? It's got me stuck ATM.
Copy linkTweet thisAlerts:
@Troy_IIIMay 01.2012 — OK, thanks for the reply. I have a basic autocomplete working using JQuery, but it doesn't work if I type more than one word; e.g. "agriculture" completes along just fine, but "agriculture in" and it stops following the typing.

Any thoughts on why this might occur? It's got me stuck ATM.[/QUOTE]


This clearly answers your question - meaning that you are best forth with a language you already know - jQuery is no substitute for JavaScript - It's more like some sort of Jamaican to it.

To correct this [current issue] - you'll need a deep knowledge of JavaScript. (i.e. Rewrite that portion of jQuerry). However...

Some dedicated jQuery forum will most probably give you a better / faster solution.
Copy linkTweet thisAlerts:
@DanInMAMay 02.2012 — OK, thanks for the reply. I have a basic autocomplete working using JQuery, but it doesn't work if I type more than one word; e.g. "agriculture" completes along just fine, but "agriculture in" and it stops following the typing.

Any thoughts on why this might occur? It's got me stuck ATM.[/QUOTE]



probably best to start a new thread for that issue. make sure to include a code sample and a link to the autocomplete plugin you are using.
Copy linkTweet thisAlerts:
@dalecospauthorMay 09.2012 — Thanks, Dan. I've [url=http://www.webdeveloper.com/forum/showthread.php?p=1206483]just done that[/url].
×

Success!

Help @dalecosp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...