May 24, 2011

Don’t worry, theirs a library for that!

Every now and again, actually more like quite often than not, developers rely on what has now become an essential part of the developer toolkit: libraries. They enable developers to have more freedom to code, and focus on proper coding which 8/10 times will just work, –and this is a good thing!

But, I have thought about all of this library usage and am curious if we as developers are starting to rely too heavily on its usage in our coding practice. I’m not saying to stop using libraries all together, that would be madness, but at the very least before you decide to include one in your coding project make sure you’re familiar with it, what it does, how it benefits the project and the language it uses.

Less Confusion during debugging

I know one thing all developers loath is when something you thought was reliable breaks down, like a new plug-in for your CMS or a core library function; either way both require you to do something about it to rectify the situation.

A good library provides a nice “security blanket" (in terms of comfort/ease, not protection) over the various differences browsers have handing specific web languages. So a little knowledge of what is going on under the hood is a good way to help troubleshoot situations. Even if you can’t fix the problem yourself, you can highlight the issues more clearly for someone who can. Even if it’s just sending a bug ticket to a library core team, every little bit helps!

Spot bad coding earlier

Updating and improving functionality is an essential part of running a website, especially CMS based ones. If you use one that has a large community involvement with plugins and modifications having some base knowledge of the languages could help you weed out the possible poor entries which could break, or harm yours or the client’s website.

Use a library at all?

Sometimes depending on your project, you might not even need a library. Although it could be nice and save you some development time, things like mobile-ready sites and page/performance factors into play once you decide to use a library. Even if the library is relatively small, like some JavaScript libraries which are around 80kb, they could affect mobile performance in some cases.

If you’re trying to do something like simple DOM manipulations then maybe you could just write something smaller yourself than bringing a whole library into the project just for a smaller task comparative to the power of the library.

Resources

Hopefully this has given some insight to programming libraries and how they can be beneficial or harmful to your project. Google provides uncompressed versions of the latest libraries for anyone to download so I’d suggest bookmarking your favourites. If you run into something you don’t quite understand about some JavaScript libraries the Mozilla MDC has some great explanations. Lastly, if you’re looking for some good examples of the potential of HTML5 will support in the future check out html5demos.com as they have a large amount of examples to learn from.

0 Comments

Leave A Comment

Leave a Reply