How to choose a jQuery plug-in?
jQuery plug-in provides a good way to save time and simplify the development, programmers don't need to write each component from scratch. However, the plug-in will also be a destabilizing factor in your code library. A plug-in saves countless development time, but a poor quality plug-in will cost more than the actual time to write your own component from scratch.
Luckily, usually you have many pls to choose from, but even if you have only one plug-in, you also need to know whether it's worth using or not, don't ever introduce wrong codes into your code library.
Do you need a plug-in?
First you need know whether you really need a plug-in, if not, then don't use any. This will reduce the code size and also save time for learning the plug-in.
1. Better to write yourself?
If the function you require is very simple, you can write it yourself. jQuery plug-ins will often come with various functions, this may be more than what you really need.
For example, if you need more advanced features, jQuery UI accordion is a good choice. But if you only need to open and close the panel. If you have yet to consider to use jQuery UI on your website, then jQuery slideToggle () or animate () may help.
2. Whether you are using a similar plug-in?
When you find that a plug-in can not provide everything, you need to look for another plug-in to make up, very temptation. But in the same application, including two similar plug-ins is certainly not a good choice.Can you find a plug-in including all your needs? If not, can you extend one of the plug-ins to reach your needs? Similarly, in deciding whether to expand a plug-in, weigh the benefits and development time.
For example, jQuery light box is a good choice to display a pop-up photo gallery, simpleModal is a great way to show the user mode information. But why have these two ways on your website? You can easily extend one of them to cover both needs. Better find a plug-in which covers everything, such as Colorbox.
If you need to display dynamic content requiring conditional prompts, jQuery Tooltip is essential. However, if only a few place you need to be prompted , it is best to use pure CSS. You can make further use of CSS3 transitions animation, but do not forget that the animation will only be effective in certain browsers.
4. Weird options and parameter syntax
Some plug-ins accept a jQuery object as a parameter, but not allowing chaining of the object, this may not be a good plug-in choice. For example:
5. Few or no documentation
It's very difficult to use a plug-in if there is no documentation, because this is the first place to find answers to your questions. Files in various formats, appropriate documentation is the best. If there is no documentation, or just a simple example is published in the blog, then you may want to consider other options. A good document shows the author of the plug-in cares about users. It also shows that they have studied other plug-ins, know the value of good documentation.
Reference : http://blog.jobbole.com/29407/
Wait! Which sort algorithm to choose? Quick sort? Bubble sort? Insertion sort? ....