Google Closure? My first thoughts…

Google ClosureYesterday, I learnt something new about Google JavaScript library called Google Closure. Oh, no! Not really, because I learnt everything what I know about Google Closure yesterday and today. So I will share few thoughts about it. If you know something about this set of tools, you can share you things, experience, so on… with us on the bottom of the page.

How did I meet Google Closure?

Basically I found Google Closure, because of OpenLayers JavaScript library. May be, You are asking, why I get to know Google Closure because of OpenLayers? It is just geographical JavaScript library. Yes, You are right! But OpenLayers are being rewrited. New OpenLayers 3 will come out with a support for modern HTML5, CSS3. And new OpenLayers 3 are based on Google Closure libraries. I found it interesting, so I started to find something about it. And I found a session from this conference:

What else did I learn about Google Closure?

Google Closure is not only library, it is new way of doing JavaScript! In this time, Closure is divided to four main parts:

  • Compiler
  • Library
  • Templates
  • Linter

Closure Compiler

It is not a compiler in normal sense, it is not translating a programming language to binary code, but it makes human readable (or whatever else) code to better, faster downloadable and runnable JavaScript as it was before. It removes unnecessary characters, spaces, comments and dead code and after it will minimize what is left.  Not only this. It check your code, errors, syntax problems.

It can compile code almost every javascript code, but it is most effective in compiling a real Closure JavaScript code.

Closure Library

Basically, It is a JavaScript library best suited for huge projects with tons of coding. It is well tested as well. How do I know it? Because it is base JavaScript library for Google Search, Gmail, Maps, Docs, Sites, Books, Blogger, Calendar, Google+ or Photos. I think it is really well tested. Now it became an Open Source.

You can find there a good documentation, large set of UI controls or widgets, or many other utilities for manipulating DOM,  for animation, server communication,  rich editing and more, and more.

Closure Templates

It is a server and client base templating system. Templates are customizable, easy to use for programmers. It has easy and not complicated syntax. You can build your application interface very easily. It has for example these pros: Convenience, they are language neutral, client-side speed. It is easy to read. Basically it is not a framework, but it is a tool. It is well tested, for example in Gmail or Google Docs, they are secure.

 Closure Linter

It is another stuff, for checking. Closure Linter checks style of your code, missing semicolons, spacing or presence of JavaScript documentation annotations and much more. It can automatically fix some errors, it makes you sure, that your Javascript style is follows Google JavaScript Style Guide.

So what?

Good point! So what? What do you want to do with Google Closure? Do you want to try it?

I do! I want, I want to learn more about it, because I see it as powerful tool. I believe, that this library will influence web a lot, because it is new way of writing Javascript code. If my enthusiasm will be same, or even bigger, I will write deeper thoughts, tutorials,… about this topic. So keep reading!

The only source of informations was here.

Please tell what you think