Re:JavaScript Structs
by conartist6 on Friday October 11, 2024 @10:21AM
(#41809708)
"let" is one of the good parts. Just don't use const or var.
Re:JavaScript Structs
by yakshaving_jgt on Friday October 11, 2024 @10:38AM
(#41809862)
Why is it? Why is block scoping useful?
Re:JavaScript Structs
by colejohnson66 on Friday October 11, 2024 @03:13PM
(#41812554)
Because it's how almost every C-syntax-like language works. JavaScript is the odd one out.
Re:JavaScript Structs
by yakshaving_jgt on Friday October 11, 2024 @03:19PM
(#41812613)
I’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.
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.