Can someone please explain to me what bug people think they are catching by choosing `const` in ES6 programs over `let`?
@keithwhor the reason not to use const is that let already protects you from casually reusing the binding.
-
-
@wycats casually reusing by redeclaration, sure. But I think the idea is to follow old best practices and keep variables declared at the... -
@wycats ... Top of their respective blocks. Const then gives a developer perusing your code immediate context as to what might happen -
@wycats I think it had more to do with readability, flow and intention than it does with execution. -
@keithwhor if your style is never to mutate the bindings, what is let buying you? Sounds like you want to teach ppl to const instead? -
@wycats ... I probably don't want a developer reassigning my factories or "classes" -
@keithwhor so you're protecting your bindings from future developers on your team? -
@wycats on my team or, really, any newbie developer that tries to reason about my open source software.
End of conversation
New conversation -
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.