Skip to content

Google Closure.. will you register your code with the Borg?

“Think! Think! Think!”, said Pooh.

Today Google announced Google “Closure”, a set of tools for efficiently working with javascript. With Google Closure Google has theoretically “closed the loop” on a number of javascript problems. Not problems developers have with javascript, but problems Google has with javascript. The problems haven’t been solved, mind you,because we don’t all use Google Closure for everything yet, but conceptually, if we did, Google would have a much easier time as web overlord.


I think it’s important to change perspective for  a moment, from the Google PR and developer world perspective, to the competitive SEO perspective. I’m not saying any of this is true fact; I’m merely implying intent the same way Googlers often imply intent when looking at webmaster activity. I’ve seen Google employees look at a web site that appeared to be clean, and mark it untrustworthy simply because the webmaster appeared to associated with other sites that were not as clean. That’s the world Google forces us to live in, so Google should live in the same world. If Google expects us to be slimy, it’s a pretty safe bet that Google behaves that way as well.

So what’s this Closure stuff? Google released Closure as four related tools for working with javascript. First, a js compiler, which “compiles web apps down into compact, high-performance JavaScript code“. There is a Firefox tool, which helps you see into compiled code for debugging, since without that no developer would compile anything that wasn’t considered 100% finished. There is a “well-tested, modular, and cross-browser JavaScript library” called Closure Library,  and finally closure templates, which make working with the Closure Library easier if you are totally committed to The Google Way and comfortable building js apps on someone else’s framework.

So what’s the SEO perspective? Well, you should go back and re-consider why Google may have started hosting the most popular javascript libraries on the Google content distribution network last summer. I raised the issue then but didn’t highlight specific reasons why I was giving it so much attention. Google has long distrusted javascript. Since Google can’t actually crawl and interpret all of the javascript that may be modifying published web content on the Internet, js provides clever webmasters with a means of resisting the Borg. But if we all pulled our standard jQuery and MooTools and prototype js libraries off of Google’s CDN, Google could “trust” our sites more than sites which hosted their own js libraries.There wouldn’t be any “funny business” if the libraries were known to be clean.

With Closure, Google is able to go a step further *if* we all adopt it. Javascript submitted to Closure for compilation could be “indexed” and assigned an id code on the web, so that from that point onward Google would be able to recognize (and trust?) that compiled code. Any change would necessitate a recompile (or, in other words, re-registering your javascript code with Google). Given Google’s development of the Chrome browser, Google could also offer additional incentives for code registration — it could run faster in Chrome. Or it could be pulled from the CDN like jQuery, and your project might benefit from a kick-start if you use the Closure Library and Closure Templates.

Again… I’m not saying this is Google’s intent with Google Closure. I am saying that if I were Google, I would certainly explore this as an opportunity to advance my control the web without stifling innovation as much as I would otherwise have to… such as Google has been doing lately.

With Closure, Google closes the javascript loop, with what is basically registration of js code with the Borg. Like it or not, whether Google does it today or not, it is a viable option for Google, and certainly easier than trying to license white hat SEOs.


Related questions that Google should probably answer if it wants support from developers:

  • is this intended to compete with jQuery? Compliment? Or are devs expcted to pack jQuery through Closure, too?
  • why built another js minifier? Dean Edward‘s Packer works very well… even better than Closure according to early reports.
  • what about Google Web Toolkit js library? What’s the roadmap here.. or is there a js roadmap at all?




  1. Anna Green wrote:

    Google have been busy of late, im tempted to say that there is almost too much going on! I think that the thing to remember with google is that at the end of the day they are trying to supply the public with good honest and accurate information. They have to respond to what already out there to do this and although sometimes we feel like we are part of a regime its all for the greater good. I think

    Friday, November 6, 2009 at 3:29 am | Permalink
  2. Mike Portson wrote:

    I can’t help it – Borg will always be for me that strange guys from Star Trek Next Generation – those with white skin and funny tool instead of their hands. But thinking about Google’s way of treating search engine results I must say that Your post seemed to be interesting and I read almost the whole of it.

    Friday, November 6, 2009 at 5:59 am | Permalink
  3. You can find more details on using Google Closure API with ASP.NET at C# Wrapper for Google Closure Compiler –

    Monday, November 9, 2009 at 10:43 am | Permalink
  4. Keith wrote:

    I couldn’t help but smile when I read the Google Closure page…sounded just a bit too smooth, a bit to warm and fuzzy…which always makes me think “What is the underlying agenda here?” So, I guess the theory is, “If we (G) can’t keep up with js “innovations” then let’s encourage the developers to work within the guidlelines of what we CAN read/see.”

    To be frank, it’s all getting a little too weird. Had an interesting dinner table discussion with a few mates last weekend that kicked off with the notion “What if Google broke one day?” Needless to say, these kind of stealth encroachments “in the interests of quality” make many people nervous. Do we really want a completely Google world?

    As always John, insightful and makes one slightly paranoid.

    Wednesday, November 11, 2009 at 8:28 pm | Permalink
  5. Jon Henshaw wrote:

    I suppose then it should be called “Google (dis)Closure”

    All I want to know is if I pull my js libraries from Google, will they count it as part of my page load time? And if I get 1 Google point for hosting my js on their servers, but my local files load faster than their overloaded js servers (refer to vague, non-descript, non-committal message from Matt about how 2010 being the year of the speedy site), will I lose 1 Google point, thus negating my original point?

    (Oh, and while I just made up Google points, I encourage you to spread my lies.)

    Sunday, November 15, 2009 at 9:22 am | Permalink
  6. john andrews wrote:

    Yes, Google Points. Nice and simple. But, Google will probably want that to be binary, as in 1 you’re in and 0, you’re out.

    Monday, November 16, 2009 at 4:50 pm | Permalink
  7. Johannes wrote:

    Well, this post is flawed in multiple ways. I’m not sure if you have any understanding of web development and javascript in particular.

    That’s a declarative statement, authoritative sounding, but complete false. Welcome to my blog. 
    First, you do not have to use the Google Closure Compiler web service. The compiler is also available as Java code which you can run locally; effectively, that means big G will never even see your source code.

    Step back to when this post was written; you can’t rewrite history. And if you can now download and run it locally, so what? Just as Google claimed Chrome was “open source” because they offered a separate product “Google Chromium” with source that could be compiled yourself, didn’t change the fact that Chrome was closed source. They don’t disclose Chrome’s code in the Chromium package… it’s a separate package. That’s slight of hand. I don’t know if you are a Googler or just a fanboy, but your statements here appear disingenuous.
    Second, assuming they could mark a site as “safe” (not even sure what you mean with this) just because the library they host on their servers has not been altered is simply hilarious. The point of a library is to provide some common tools that you can use in your own code. The library itself does not change anything on your site; it’s only your own code that you write on top of the library tools that does something with your site.

    I’m glad you find it “hilarious”. I wish you made sense, though. You started by stating I misunderstood how js operates, yet this statement of yours is clearly confused. If I run a jquery plugin, which is open source so I can customize the code, it is no different than  “my  own code”. If I only run jquery pulled from Google’s CDN, it’s not my own code. Google has already admitted it inspected the hosted code. What more do you need? Again, you appear to have an agenda.
    Third, if Google really had the ability to parse, and understand javascript code automatically, there would be no way to prohibit them from simply downloading the code you host on your server. It does not matter whether you send them the code actively, or if you make the code available through your website. As soon as it is publicly reachable they can get it if they actually want to.

    Silly boy. How much work would it be for Google to “download the code I host” on my server.. for every website on the Internet? Too much. So Google will try and manipulate the marketplace to help shift things towards Google, such as encouraging use of the CDN for js code. Sounds like you not only buy their story, but support and promote it.

    You’re welcome to come here and discuss or even argue my points, but if you start by calling me out and then add nothing but  nonsense (or propaganda– I can’t tell yet) you are not welcome. Come on, make yourself welcome. Try harder?

    Tuesday, March 30, 2010 at 2:58 am | Permalink