Andrea Giamarchi writes about JavaScript, covering DOM performance, language quirks, abstractions and critiques of tools such as Google Closure.
HN commenters dispute some of its claims, such as sorting performance, and cite it in debates about Google's code and the `with` statement.
Sure there are - why are so many Crockford pronouncements taken as a signal to stop thinking?
Notice that his "with is bad" examples (which are usually bad examples and bad usages [1]) always involve contrived examples of potentially ambiguous assignment - one of the more useful ways to use `with` is with objects whose properties are DSL-like functions, named in such a way that there's no mistaking their origin and with no ambiguous assignment involved.
Simple example with includes: https://github.com/insin/DOMBuilder/blob/master/examples/reddit_posts.html#L18-47
More extensive example of inheritable templates for a CRUD admin app: https://github.com/insin/sacrum/blob/master/lib/sacrum/admin.js#L277-439
[1] http://webreflection.blogspot.com/2009/12/with-worlds-most-misunderstood.html
The author appears to be completely wrong.
While the spec doesn't say anything about the expected performance, there's no way a real Javascript implementation uses an O(n * n) algorithm.
Indeed, http://blog.rodneyrehm.de/archives/14-Sorting-Were-Doing-It-Wrong.html a couple of years ago wrote "While InsertionSort and MergeSort (Apple and Mozilla) are stable, QuickSort (Google Chrome) is not (Issue 90). Chrome will sort arrays using InsertionSort if the array has 10 or less elements" and http://stackoverflow.com/questions/234683/javascript-array-sort-implementation agrees. http://webreflection.blogspot.se/2009/04/internet-explorer-and-its-inefficient.html extends the comparison to IE and Opera, showing that they are also n * log n implementations.
> You're implying that Wave engineers don't know how to use Java. But Wave engineers are Google engineers. Google engineers are hired somewhere in a high 90th percentile of programming ability and experience.
I'll just leave this here (Dart - the new language from Google). http://webreflection.blogspot.com/2011/10/what-is-wrong-about-17259-lines-of-code.html
I think you're a little too trusting that every single Google programmer knows what they're doing.
Greetings, author of the post here :)
This post was, of course, just a thought exercise. But if it sounds intriguing, please check Andrea Giamarchi's much more advanced "JavaScript Hypertext Preprocessor":
http://webreflection.blogspot.com/2011/06/javascript-hypertext-preprocessor.html
He has stuff like:
$Object->prototype->toString->call($o); // [object Object]
Is it just me, or is it becoming fashionable to criticize google's code? This one is a few days old:
http://webreflection.blogspot.com/2009/11/google-closure-im-not-impressed.html