O'Reilly logo

JavaScript Programming: Pushing the Limits by Jon Raasch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2

Libraries, Frameworks, and Plugins

In addition to following best practices, you should build your app on a solid foundation of libraries and plugins. Sure, you could write everything yourself, and there is indeed a time and place for that. But in most cases, it makes more sense to rely on the open-source work released by other developers.

Libraries and plugins can help speed up your development process and jumpstart your app with a boilerplate of basic functionality. Best of all, the well-known libraries have a huge community behind them, with excellent developers writing and rewriting the code, and a vast user base uncovering any bugs. With the more established, tried and tested libraries out there, you can be confident in using them in your application.

Plugins, on the other hand, are a little spottier when it comes to code quality. A good plugin saves you loads of time, while a bad plugin may end up creating more problems than it solves (and force you to spend more time debugging it than you would have spent writing it from scratch).

In this chapter, you discover how to choose the right JavaScript library for your project. I compare jQuery, Zepto, and writing your own vanilla JavaScript. Then you learn about the larger frameworks Bootstrap and jQuery UI. After briefly discussing how Modernizr can streamline cross-browser CSS issues, I show how HTML5 Shiv builds support for HTML5 elements in older browsers.

Next, I discuss HTML5 Boilerplate, which is neither a library ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required