• On The Insider: Britney's Bikini-Clad Top 10
November 5, 2009 10:30 AM PST

Google offers JavaScript programming tools

by Stephen Shankland
  • Font size
  • Print
  • 7 comments
Share

With a project called Closure Tools, Google plans on Thursday to start helping developers who aspire to match the company's proficiency in creating Web sites and Web applications.

Google is a strong proponent of using JavaScript to write Web-based programs, part of its Web-centric ethos. Indeed, the company has pushed the language to its limits with services such as Gmail and Google Docs, and it developed its Chrome browser in part to enable JavaScript programs to run faster.

But writing, debugging, and optimizing heavy-duty JavaScript can be difficult--in part because a given JavaScript program sometimes works differently on different browsers. Google's open-source Closure Tools project is an attempt to help with some of these challenges.

The first in the suite of tools is the Closure Compiler, a software package designed to boil down a JavaScript program so it's smaller and runs faster. For example, a function named DisplayAddress() could be replaced with just a().

Along with the compiler come some extra tools that run in the Firefox browser. One, Closure Inspector, is an extension for Firefox's Firebug add-on designed to help programmers understand and debug the rewritten JavaScript--linking a() back to DisplayAddress(), for example. Another add-on for the Google Page Speed extension lets programmers see how much the compiler helped.

Google also plans to make the compiler available as a Web application hosted on its Google App Engine service.

The second element is called the Closure Library, a collection of prebuilt JavaScript code that lets programmers handle relatively sophisticated technology--arrays and string manipulation, for example.

Last are Closure Templates, more prewritten code to ease creation of JavaScript and HTML user interfaces.

In an earlier era, programming tools were expensive packages bought by a select few, but open-source software, new marketing strategies, and new business methods have made that approach the exception rather than the rule these days. Now programming tools are often a means to another end--encouraging programmers to produce the software that will make Windows or the Palm Pre useful and therefore popular, for example.

In Google's case, the objective is often to make the Web more popular because it sees more activity on the Web as corresponding directly with more activity on its revenue-generating search site. Among the high-profile projects to this end are Chrome, Chrome OS, and Android, all subsidized by Google's powerful search-advertising business.

One interesting contrast to Closure is another Google project called Google Web Toolkit. It's designed to accomplish some of the same goals as Closure, including paving over browser incompatibilities and producing high-performance JavaScript. But with GWT, coders write programs in Java that gets translated into JavaScript.

So one last question: why the name?

Google's reply: "Being a functional language, the concept of a function closure is fundamental to the JavaScript language."

Stephen Shankland writes about a wide range of technology and products, but has a particular focus on browsers and digital photography. He joined CNET News in 1998 and since then also has covered Google, Yahoo, servers, supercomputing, Linux and open-source software, and science. E-mail Stephen, or follow him on Twitter at http://www.twitter.com/stshank.
Recent posts from Deep Tech
At a loss for words? Google offers search by sight
Navteq to supply Microsoft with 3D map data
Google acquires EtherPad online collaboration tool
Google edges toward Rosetta Stone status
Google wants to unclog Net's DNS plumbing
Phone photo quality interests Google, Microsoft
Intel hopes 48-core chip will solve new challenges
With an eye to the future, try raw photos today
Add a Comment (Log in or register) (7 Comments)
  • prev
  • 1
  • next
by Teja81 November 5, 2009 11:00 AM PST
Will developers now move from jQuery to the "Closure Library" ?
Reply to this comment
by Hunnter2k3 November 5, 2009 11:03 AM PST
Well now... i certainly have to try this out at some point, especially if it has some templating and optimization.
Speaking of compressing things, I need to go compress 700+ divs in to a loop.
Reply to this comment
by forever4now November 5, 2009 11:37 AM PST
I think I read that GWT (Google Web Toolkit) can be used to write Java apps that can be:
1. packaged & deployed as a local Android app.
2. compiled to optimized JavaScript, etc. & deployed as a web app.
If so, that capability alone makes GWT sound like a great tool.

For pure JavaScript programming, the Closure Tools could turn out to be quite interesting.
Reply to this comment
by Money2themax November 5, 2009 11:52 AM PST
Anyone else think that the logo used looks suspiciously like the sansa logo?
Reply to this comment
by 01Phyxius November 5, 2009 3:21 PM PST
All I see are four Pac-Mans and a square created by the negative space.
by Dalkorian November 9, 2009 9:43 AM PST
I think it would be four Pac-Men.
LOL. ;-)
by manalagi001 November 5, 2009 12:01 PM PST
Closure compiler failed, can't compile large .js files. It's large .js files that most need minification and optimization!

Closure templates' utility escapes me. Seems overwrought. Examples are rife with presentational elements. And it requires adopting new tools and new syntax? No thanks.

Closure library is undeveloped and poorly documented. I think we're better off sticking with YUI or JQuery.

However, Chrome and the developer tools within Chrome, such as the various inspectors and step-through Javascript debugging, are a boon to javascript developers.
Reply to this comment
(7 Comments)
  • prev
  • 1
  • next
advertisement
Click Here

The yogurt makers of tech: Gadgets to avoid

Don't buy these one-trick ponies--unless you like gizmos that gather dust.

Google wants to unclog Net's DNS plumbing

The Net giant, ever eager for a faster Internet, debuts its Google Public DNS service. With it, Google could become even more central to the Net.

About Deep Tech

Stephen Shankland, who's covered the computing industry since 1998 and was a science reporter before that, here delves into a wide range of technology trends and offers hands-on tests. His particular interests include Web browsers, cameras, standards, research, science, and start-ups.

Add this feed to your online news reader

Deep Tech topics

advertisement
advertisement

Inside CNET News

Scroll Left Scroll Right