Re:Google Closure: How not to write JavaScript
by aboodman on Monday December 13, 2010 @01:27AM
(#1999587)
Here is an example of a real-world performance bottleneck that was discovered by the closure team:
Re:Google Closure: How not to write JavaScript
by bluekeybox on Monday December 13, 2010 @12:46PM
(#2001289)
> Time in web applications is not used looking up array lengths - it's used in IO, layout, and DOM manipulation.
Unless you're implementing a cross-browser stable sorting algorithm for manipulating tables 50,000 rows long or longer (that was exactly my most recent project). Don't say "it should be done on the server" because that statement is true only as long as everybody keeps writing bad Javascript.
Closure was not thrown together by novices new to the language. It was started by Erik Arvidsson and Dan Pupius, two JS hackers that have been doing this kind of work longer than just about anyone else. Its differences from other libraries aren't the result of ignorance, they're mostly the result of conscious tradeoffs to make compilation more effective.
Edit: Oh, and the string thing... If you ever do
in JavaScript, you're doing it wrong.