Google Releases Open Source JavaScript Tools 158
Dan Jones writes "Google has open sourced several of its key JavaScript application development tools, hoping that they will prove useful for external programmers to build faster Web applications. According to Google, by enabling and allowing developers to use the same tools that Google uses, they can not only build rich applications but also make the Web really fast. The Closure JavaScript compiler and library are used as the standard Javascript library for pretty much any large, public Web application that Google is serving today, including some of its most popular Web applications, including Gmail, Google Docs and Google Maps. Google has also released Closure Templates which are designed to automate the dynamic creation of HTML. The announcement comes a few months after Google released and open sourced the NX server."
Re:Embracing and extending (Score:2, Informative)
You can turn on the old comment system (well, the pre-javascript one, I don't remember if it is the same as what there was in 1997).
Re:My gawd (Score:5, Informative)
Why are people investing so much in a fundamentally flawed scripting language that has almost no use at all outside the browser and that Palm Pre thing that is basically a browser in a plastic case?
Actually JavaScript is a rather good language in many ways, though it does have some flaws. Give "JavaScript, the Good Parts [oreilly.com]" a quick read some time.
The main problem in the place where people usually see the language, in the browser, is when interacting with the Document Object Model in browsers - a model that isn't exactly my favourite environment to start with and that is before considering all the hacking you have to do to get things to work well on multiple browsers (even when only considering modern versions).
Apache v2.0 (Score:5, Informative)
It seams silly to mention that it's open source without giving the license. Btw It's not copyleft, allows linking from other licenses and is GPLv3 compatible
Re:Unimpressive (Score:4, Informative)
http://code.google.com/closure/library/ [google.com]
Re:jtemplates vs. closure templates? (Score:2, Informative)
You know what'd be great? If there were more tutorials that show off a lot of the functionality you can achieve with closure. Hello world and notepad editors just don't cut it as demos. (Hint hint google
Re:jtemplates vs. closure templates? (Score:2, Informative)
P.S. WTB edit feature on slashdot.
Lego-like (Score:5, Informative)
The Closure Library has a lot of useful-looking classes and functions, like for working with Arrays, Dates, or the URL. They're divided into short files, so that you can use just the parts you want and not have to download one big file.
jQuery has definitely been a great library, especially at finding things in the DOM. And I think its API for handling events is easier (definitely less to type) than this. But it doesn't have all of the things that this has --- short helpers that probably I would end up writing on my own (and already have started to).
I'm also interested in the UI Widgets like an Autocomplete text field. I've been waiting for the jQuery UI team to finish that one widget for months, but for some reason their development is so slow!
Standard Disclaimer about JavaScript:
Like has been said, watch the Google Video "JavaScript: the Good Parts" to elaborate on this. And if you hate JavaScript but are forced to write it and haven't read JavaScript: The Definitive Guide, it's the best book on JavaScript and one of the best O'Reilly books period.
Re:Closure/Clojure/closures (Score:1, Informative)
A homophone is a word that sounds the same as another but has a different meaning. I just wanted to make sure you got a post from someone who thought you were serious.
Re:My gawd (Score:5, Informative)
I'd like to have real OO syntax
What is it about JS's OO syntax that isn't "real"?
Is it because it's prototype-based instead of the class-based paradigm that you're probably used to? There are actually some advantages (and disadvantages) [gatech.edu] to this approach. Just because it may not be what you're used to or comfortable with doesn't make it bad.
It's also faster than Python (Score:3, Informative)
And Ruby, PHP and Perl. Check it out for yourselves: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=v8&lang2=python&box=1 [debian.org]
Re:My gawd (Score:5, Informative)
To extend the analogy someone else used earlier, OO in Javascript is like attempting to tighten a screw with a hammer.
I respectfully disagree.
See for example John Resig's approach [ejohn.org]. Basically it adds more familiar class-based inheritance to JavaScript, building upon the existing prototype-based inheritance. I am using it in a large project (see my homepage link), and it works great. Btw, it seems Google has something similar in the Closure Library, as well, but I didn't check if it was as concise as Resig's.
JavaScript is a flexible language (Crockford once called it "Lisp in C's clothing"), which lets you 'extend' it in ways like the one linked to above.
Re:My gawd (Score:1, Informative)
on of the most elegant inheritance models I have ever seen is written with JavaScript [dojocampus.org]
Re:Lego-like (Score:2, Informative)
I'm also interested in the UI Widgets like an Autocomplete text field. I've been waiting for the jQuery UI team to finish that one widget for months, but for some reason their development is so slow!
I've been using the original autocomplete plugin [bassistance.de] for a long time now, it works great. This is the plugin that is used as a basis for the UI autocomplete component. Anything preventing you from using it in the meanwhile?
JavaScript isn't more flawed than other languages. (Score:2, Informative)
If you think Javascript isn't very powerful and cannot see its advantages, particularly with dynamic types, then you obviously haven't used it.