Thursday, November 12, 2009

via Hacker News - Some Sitepoint Article: How not to Critique a Javascript Library

(I will not link to the original trashy article.)

A modern-style library in ChambéryImage via Wikipedia

The Google Closure library [ one part of the Google Closure project http://code.google.com/closure/ ] is not bad, and will only get better. Both the Closure library and the jQuery library will grow and improve in the brave new future of first rate JavaScript compilers in web browsers
Hacker News | Some Sitepoint Article: How not to Critique a Javascript Library:
Really? You tested it? Because a 'switch' does not necessarily generate the same code as a dynamically constructed set of object properties. In Google's original example, if none of the cases match, it immediately returns 'true'. In Sitepoint's example, if the property does not match on the highest level, it must crawl the property chain on the object until it eventually reaches 'undefined'. Not to mention you are making two inner function calls and a fully dynamic property lookup (!(), hasOwnProperty, and node.tagName), none of which I believe can be calculated statically. Actually, I'm going to end this rant early, because I just read more of the article, and it looks like the author just keeps pulling random shit that he remembers reading from 'Javascript: The Good Parts' or whatever and vomiting it back up onto his keyboard.

Raytracer in JavaScriptImage by schoschie via Flickr

Also, the original article has no time tests under V8 [ http://code.google.com/p/v8/ ] after passing through the Google Closure compiler. Or any time tests at all. Pathetic. Shame on Kevin Yank and Dmitry Baranovskiy.
Reblog this post [with Zemanta]

No comments: