Google Closure javascript API – good or bad?

Since I first started to juse jQuery javascript API I have been a happy programmer! Things like cross browser, easy widget implementation and animation were suddently very easy to use. It was fast to implement, ran fast and as mentioned were rock solid accross browsers on various platforms! Finally: It started a trend of worldwide unity amoung developers – people very moving as a group.

Javascript frameworks – a litle background
Last year Microsoft realized that jQuery was a very powerfull and solid javascript framework, the simply decided to adapt it and use it as their prefered javascript API. Not a thing which done often by such a big player! The company which perhaps has as many people who hate it as it has followers realized that open source code is something to respect and adapt!

Google Colsure on the other hand – what is it? As I understand the framework is something which Google has developed for internal use, and now has opened up, so that everyone are free to use it. I must admit that I am not totally into all the terms of use and the history of this framework. However IMHO:

We don’t need Google to put one more player on the field of javascript frameworks! When it comes to javascript frameworks we need the unity amoung javascript developers – and a framework like provides all the extensibility for any Google special needs. 

What to do with “the new Microsoft” :-) ?
It would be unrealistic to expect Google to “drop” its Google Colsure framework, but us – the javascript developers – might put presure on Google (the new Microsoft?). I for one do not need another javascript framework. So I will continue using jQuery.

I do not see Google as the new Microsoft – and Microsoft is not a bad company in my eyes. What however is bad is when one company is too big and can ignore other players without getting into trouble. Google is probertly not trying to push other javascript frameworks out of the field… Right Google? :-) Perhaps Google could try to convert their ideas into extentions/plug-ins to jQuery?

Other opinions about Google Closure
Using TweetDesk I set up a search for “Closure Library” to follow the tweets about the Google Closure Library. Just followed one of them to: http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/

image

That article was written by Kevin Yank and he referes to some Google Colsure critism spoken by Dmitry Baranovskiy. I myself have coded many lines of javascript and learned things just by reading this article! I also saw some scary “mistakes” which Dmitry pointed out in the new Google Closure framework. One of them was testing if a var was of the type String (From base.js, line 742):

1
2
3
goog.isString = function(val) {
  return typeof val == 'string';
};


The problem with that method (isString) is simply that it fails if you call it with a String object! Not cool! If you call it like this: goog.isString(new String(‘My string’)) it will return false!

Ofcause nothing is perfect, and the points by Dmitry Baranovskiy could easily be changed as a normal bug is fixed in any javascript framework. What scares me is the fact that many people seem to think that Google equals perfect, and if many people are non-sceptical about things developed by Google (Yahoo, Microsoft or anyone!) then perhaps they will leave jQuery and start using Google Colsure Library… I hope not!

US

Leave a Reply