3 ms·
> Like, you can declare a variable with var, let or const but there's absolutely no reason to use var any more. I am going to continue to use var for everythin
by yakshaving_jgt 2y ago
> Like, you can declare a variable with var, let or const but there's absolutely no reason to use var any more.
I am going to continue to use var for everything, because I think let and const are stupid.
It is not cool or interesting to learn about new scoping rules introduced by let, and it is not cool or interesting that so many people — especially juniors, but not exclusively — are lulled into a false sense of security by believing const means the referenced value is immutable, which it isn't.
I am going to continue to write small JavaScript, like from The Good Parts.
- conartist6 2y ago"let" is one of the good parts. Just don't use const or var.
- yakshaving_jgt 2y agoWhy is it? Why is block scoping useful?
- colejohnson66 2y agoBecause it's how almost every C-syntax-like language works. JavaScript is the odd one out.
- yakshaving_jgt 2y agoI’d prefer to just embrace it. Keep the language small. Prototypical inheritance works just fine. There’s enough in The Good Parts to get all the work done.