Javascript Libraries
Have you ever looked at a website and seen some cool feature which you thought you would like to implement on your own site? Many times I have hit this scenario and I am surprised at the number of times I have traced the feature down to one of a number of popular javascript libraries. The point to take from this is that using one or more of these javascript libraries appears to be the fastest and neatest way to implement client-side functionality on your site. Some of the benefits of using these libraries include:
- a set of API interfaces already written for you
- encapsulation of the data – classes are already well designed and implemented
- regular updates keep the code current
- well tested and open-source availability (and all the benefits that come with that)
- well documented APIs
- impressive feature set
One downside is that some of them can be relatively large and it is an unnecessary bandwidth overhead (for both you and your visitors) if you only want one or two of the features the library provides. However, Google has anticipated this issue and now provides a service to host these libraries for free on their servers. If you use the libraries hosted on their servers, there can be many benefits. Most notably of which is the improved load speed for your site visitors. The more webmasters use these libraries hosted by Google, the more their visitors are exposed to them and hence have already downloaded the relevant libs. The obvious benefit is that many visitors will have loaded the library into their cache prior to visiting your site, which both saves your bandwidth and increases their speed of access. It is a win-win situation.
Current popular libraries which are hosted by Google are:
Click on the links above to visit the respective sites and find out which features they offer. For instance, on the clickinlove dating site, you have the ability to upload multiple images and see a loading progress bar for each image. This feature is not technically available using just javascript functionality, but is possible by combining javascript with a Flash module). The SWFObject library makes this relatively easy to implement and the end result is a streamlined intuitive interface for visitors to clickinlove to utilise. The development time for me to have written this by myself would have been much longer than simply using the library they provide.
I anticipate that the future of web development will make good use of centrally-served popular libraries, such as what Google is offering. To me it makes sense to utilise these libraries for the reasons mentioned above, i.e. well-tested code, great functionality, good support and easy to implement. In addition, it makes sense to have them centrally retrievable (as opposed to storing them on your own server), as it provides bandwidth savings, increased download speed for visitors and a convenient one-stop shop for all the scripts you need.