w/ const, at least we can say "it's not reassigned, not sure about mutations though". With let, you know neither. Seems uncontroversial 
-
-
which makes the scoping guarantees of either a problem too! Back to var I guess.
-
I just use let except for module-wide constants and keep my functions small ;)
-
why use let then? same problem with params
-
the reason I don't find "it's uncontroversial" persuasive is that two ways to declare variables instead of one isn't free
-
it means I'm thinking about it all the time, and keeping it in mind isn't free. In small methods, the benefits are ~0 for me
-
methinks you've made a `let` believe out of me
Or at the very least, I'm completely without opinion on the matter now. -
yay! I don't really ultimately care what individual projects choose, but I don't want people to believe it's a no-brainer :)
-
it reminds me of coffeescript param shadowing gotchas now
End of conversation
New conversation -
-
-
I've always wanted const params! (Haven't had time to put any kind of proposal together though).
@ryanflorence -
there's an experimental flag in Flow to turn all params const. Turning it on for new projects is nice
@ryanflorence -
don't think implicit const could fly in JS though
@ryanflorence -
obviously backward incompatible; nicer than const all over: shorter notation, say (=x, =y) => A*x + B*y + C
-
shorter example not as well-motivated as longer, ofc!
-
people are already willing to use `const`, two more chars than `let` -- usage in params may be ok
-
people are hostage to mutable default binding spec which cannot change -- suggests better path, esp for =>.
-
I remember in my earliest TC39 days asking if new function forms could be const params
- 12 more replies
New conversation -
-
-
I've been in a const-first codebase for a couple months and had this fool me (with bad results) more times than const saved me
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
notable: in rust the `mut` annotation is available on function parameters.
Thanks. 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.