Wednesday, 2 October 2013

Do you need JavaScript libraries?

I know jQuery. Now what? by Remy Sharp is a great reading. Just recently also John Papa had some thoughts about how we are overwhelmed with all the libraries we have today. Web development is a very rapidly changing field. Best practices of two or three years ago are not recommended anymore, popular libraries are losing their edge while others emerge to replace them, and Internet Explorer version 9 and above kind of does the job of a web browser.
The question is, of course, provocative. The right questions are: When do you need JavaScript libraries? and Which libraries do you really need? In some cases maybe all you need is JavaScript with Vanilla JS. In other cases you might need jQuery and nothing else.
Think twice before you add another library just to use one single feature it provides, or before you learn yet another templating library whilst John Resig's micro-templating solution might serve your needs.
I am currently working on a Chrome extension. I can't justify to myself using any libraries for that. It runs only in one browser and that one supports all the latest standards. It is a special example of course, but the point is: don't automatically start all your web projects with
<script src="jquery"...