4 ms·
You've set up a straw man argument. Where are these JavaScript fans who are pointing to several well-known problems with the language (e.g. semicolon autoinsert
by halo 16y ago
You've set up a straw man argument. Where are these JavaScript fans who are pointing to several well-known problems with the language (e.g. semicolon autoinsertion, the for-in loop, the poorly-thought-out type system) and saying they're JavaScript's strengths? No-one is saying the language doesn't have flaws.
JavaScript's strengths are that it's small and surprisingly powerful and flexible, in spite of its design mistakes.
(N.B. The bug with closures is associated with a problem in a single use case with IE6's garbage collector, and Microsoft patched it two-and-a-half years ago.)
- statictype 16y agoN.B. The bug with closures is associated with a problem in a single use case with IE6's garbage collector, and Microsoft patched it two-and-a-half years ago. Are you sure about that? From what I understood they couldn't patch it because some major unnamed web sites actually relied on DOM elements not being cleaned up to work properly. http://blogs.msdn.com/b/ericlippert/archive/2003/09/17/53028.aspx http://blogs.msdn.com/b/ericlippert/archive/2003/09/17/53028... As of IE 7, I remember I still had to close out memory leaks on some code that was binding an event to a DOM node.
- pornel 16y agoThat blog post shows their workaround for faulty GC caused problems, not that correct GC wouldn't work. My guess is that forced DOM tear-down broke cross-frame/window references. This is not necessary in implementations that let GC clean up DOM nodes.