3 ms·
By waste of time do you mean performance or coding time? I feel like writing a character more is not a waste of time, if you are just following the convention t
by aledalgrande 7y ago
By waste of time do you mean performance or coding time? I feel like writing a character more is not a waste of time, if you are just following the convention that anything that is not going to be muted should be signed explicitly. It's not to prevent bugs, but for readability and ease of use.
- earthboundkid 7y agoTime deciding if you can/should rebind a variable or not is a waste of developer time.
- elyobo 7y agoI sort of agree; I solve this by never using let and never rebinding :) No need to think about it at all.
- earthboundkid 7y agoThen you end up playing this game of jumping through hoops to omit variables. It's a tempting waste of time because it feels productive.
- elyobo 7y agoStrangely it turns out that rebinding variables is a really uncommon need, so there's pretty much zero game playing.
- aledalgrande 7y agoThen when you will have to change or debug the same code instead of writing new, you will have to spend more time understanding what variable is the source of a state change, for example inside a loop. That is more of a waste of time to me.
- jhomedall 7y agoYou will know ahead of time whether you're going to be rebinding a variable. The use of const is a hint to the next person reading your code, since they won't be privy to your thought process. In an ideal world, const would be the default, and you would have to opt into non-const.