The question was:
My thinking in creating this poll was around two ideas:
- An excuse to educate people that using multiple libraries on the same page is generally a bad idea and not necessary.
- Uncover interesting scenarios where using multiple libraries on the same page was useful/required.
Here are the results:
As usual, a flaw in the poll
If you have any final thoughts on the matter, say your peace. New poll this week sometime.
In my opinion “jQuery, Mootools, Prototype, etc” are frameworks and “Modernizer, @nywhere API, etc” are library’s
Yep that’s the actual “flaw” here… guy doesn’t know the difference between a js library and a js framework…? Come on :/
I’d vote for that too if it was up to me.
@Harry – don’t blame me: http://cl.ly/2fFC
I’ve used multiple libraries (or frameworks) when client has specifically wanted me to use a plug-in which is written in other than jquery… because everything I write on my own I do with jquery… felt guilty afterwards :)
A good JS library or framework won’t mess around with the global scope or native objects prototypes, so compatibility issues shouldn’t be a concern. Dojo, for example, has explicit support to allow you to use multiple version of itself on a single page!
Why? Because sometimes in big projects where the development spans many developers over many years it becomes necessary to do things this way. It’s not ideal, but real life!
Here’s a use case for you:
And of course I want it dead-fast so that’s why I go with js APIs/libraries (not frameworks in my opinion).
Of course, this is just for HUGE projects, I did it just twice in 4 years.
And regarding Prototype’s habit of changing natives, well that’s just something that your project needs no live with. It’s for the best anyway.
MooTools has dead-easy DOM manipulation *and* nice OOP. :P
I thought you meant like this :
but i guess i was wrong too. because they are jQuery. so i really never knew what you meant. i put no because i thought you meant like using them for Different actions like if you were to have one for a jQuery slideshow but one that you didn’t make. i dont know im completely oblivious, still.
I used to face this problem quite a lot in one of my projects. We were working on rails, so we had already used a lot of rails ajax helpers that generated prototype code. Later we needed to use some jQuery plugins and that would cause conflicts with prototype.
We got the two working together, but I really hated having both frameworks running together. Luckily, we found a prototype plugin that had the same functionality and switched to it.
Once I hear terms like DOM, Native Object Prototypes, and what have you, my eyes glaze over. I never sat down and actually looked at how stuff works beyond HTML, PHP, and CSS, so I literally have no idea what any of these terms mean. It’s on the cards for the Christmas break. I just know ‘do this = this happens’. Monkey see, monkey do.
Maybe the next poll should be library or framework? haha
No kiddin’ eh?
This is what they call themselves:
jQuery = Library
YUI = Library
ExtJS = Library
MooTools = Framework
Prototype = Framework
Dojo = Toolkit
I thought they were all the same thing. You learn something knew every day I guess.
Criss, maybe it’s time to do a post explaining the difference between each type and when to (and not to) use them since many of us mis-understand the terms. :)
MooTools does a lot more than jQuery… jQuery really only focuses on DOM stuff. See http://jqueryvsmootools.com/. Some people would consider jQuery a “library” just because of that.
Frameworks offer a lot more functionality on top of their underlying libraries, such as ready-made accordion menus, modal dialogs, image enlargers, etc. Therefore a framework can typically be seen as a large collection of plugins in one nice package. That’s why MooTools is a lot more functional than jQuery – because in jQuery, you still need to program all the fancy stuff on top.
jQuery does have it’s own framework though – it’s called jQuery UI :-) I tend not to use it though because it’s a lot of overhead when all you need is a couple of small plugins.
Also, I would regard Prototype as a library, whereas its respected framework would be Scriptaculous.
Then again, I’m probably wrong in my definitions compared to other peoples opinions.
Actually, in the case of YUI3, YUI is definitely a “framework” in the sense that it provides an incredibly rich structure and architectural pattern for complex applications.
I believe ExtJS and Dojo can also be considered frameworks in that regard.
We try to limit our projects to one library like the poll results, and find that jQuery has most bases covered, Love jQuery! LT
Its a great sharing about this multiple java script about poll results..Its very useful.Thanks for sharing
Interesting question, it’s been an issue with my development as of late. In a nutshell, the only time it’s been an issue, is with WordPress (plugins galore). You just can’t ever the same version to run more than once, your bound to get into trouble. If you are in a pinch, Google “JQuery NoConflict” and be ashamed of your workaround.
I personally try to keep it to a limit of one, but that is just me :D
again it depends what you’re working on and what’s your budget … if the page is high budget then the answer is NO, but if i’m making a low budget page then i usualy use existing joomla modules/plugins/… without caring what library they use
still if I can, i try to limit myself to jQuery and maybe MooTools. Also I usualy check if speed will be the ranking factor (competition wise).
As always it depends on what you want to do, how much time you put into it and how much u get paid for it :)
Don’t forget the human factor flaw…as in, “I do use more than one…but I don’t want to look like a moron.” Great poll though Chris. Thanks for sharing.
that being said, I think even if i did know more than just jQuery i would still only use 1 library on a page. generally if theres a puglin thats say a Mootools plugin, 90% of the time unless its a not very widely used plugin, someone, somewhere has modified it for jQuery.
All of the above!
1.) No – I avoid it whenever possible. 2.) But Yes, I do when I have to, for example when the previous developer riddled the site with Prototype-dependent functions and I want to use Jquery because I’m more comfortable with it.
In the end, I think I have GOOD REASON to do it, but still I FEEL GUILTY about it. And thanks to Jquery’s NoConflict() declaration, everything works fine and it’s NO BIG DEAL.
But really, 1.) No.
Very useful script..nice explanation..thanks for postings
Yes using multiple JS libraries is a bad idea.