|
|
|
|
|
by baron816
3203 days ago
|
|
Defaulting to const does nothing. If you or someone else decides later that it should be reassignable, then they'll change it and not think about it. If const is rare in your code, people will be aware of what const means in that context. If you're putting your variable declarations after your return statement, then you probably have other problems. I also don't know why you would ever expect someone to do that. |
|
Which they'll do regardless. `const` is an indication that the binding is not updated in the rest of the scope and thus that said scope can be perused without needing to consider an update to the binding itself. It is a guarantee of SSA, nothing more and nothing less.
> If const is rare in your code, people will be aware of what const means in that context.
The same as above which you apparently assert is "nothing"?
> If you're putting your variable declarations after your return statement
Why would I do that? I'm not adamantly using `var` when I have no reason to.