Can someone please explain to me what bug people think they are catching by choosing `const` in ES6 programs over `let`?
@ialexi why is the compiler worse at optimizing let bindings that are never reassigned than const bindings
-
-
@wycats therefore you can prove to the compiler: this won’t change. No, seriously. I’m not gonna change it.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats and the eval could be in that scope or any child scope, and boom can’t optimizeThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats it should be possible to statically analyze let and optimize it out, but if there is any single eval-like call it breaks.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats but even in small funcs it can serve as statement of intent (docs) stating that it doesn’t change (just like we often all-caps)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats probably most important for global-ish scope variables, and less important for in small funcsThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.