|
|
|
|
|
by _getify
3939 days ago
|
|
I would genuinely (no sarcasm) like to read a blog post that makes a stronger argument (in either direction) than mine. Most blog posts I've read about `const` cite very flimsy things like "it makes my code more readable" without any real meat as to why that's true. I tried to debunk that with careful thought. If someone has more convincing arguments besides subjective opinion, I'd love to read them. |
|
Well you didn't really succeed. Your argument against using const comes down to "someone might violate expectations or remove the word const, so let's not even try". I don't agree with that.
Traditional constants are used to show that nothing changes in large swaths of code; showing how much benefit you get in a standalone 12 line function is not meaningful.
Also, calling function scoping bad is not revisionism. That is not a new idea, and does not depend on 'let' existing.
Edit: And the the article you linked about let is saying so many ridiculous things I won't even try to respond to it, but jeez. 'implicit'