News for hackers. Stuff that matters.
Re:JavaScript Structs by thot_experiment on Thursday October 10, 2024 @03:20PM (#41802451)
> but there's absolutely no reason to use var any more

Naw, var has function scope and hoisting, both of which are useful.

Re:JavaScript Structs by afavour on Thursday October 10, 2024 @03:28PM (#41802546)
Not in a sensible codebase
Re:JavaScript Structs by hinkley on Thursday October 10, 2024 @04:26PM (#41803204)
My job isn't to be infatuated with your code. It's to get through your code and get stories done.

People don't really get better at handling the complexity of large code bases. We are fundamentally the same organic matter that existed prior to the first computer coming into existence. So as code bases and library bases grow larger and larger, they need to be proportionately easier to read or even ignore.

Your code needs to be dead boring 90% of the time, otherwise you're imposing on your coworkers. And using variables before they're declared is just shitty behavior.

Re:JavaScript Structs by thot_experiment on Thursday October 10, 2024 @05:43PM (#41803886)
Sure and I'd accept the weaker claim that "there's no reason to use var in a production codebase touched by many people"
Re:JavaScript Structs by yakshaving_jgt on Friday October 11, 2024 @04:56AM (#41807654)
> Your code needs to be dead boring 90% of the time

I also prefer boring code, but I think having the choice between var, let, and const is less boring than only having var.

Re:JavaScript Structs by hombre_fatal on Thursday October 10, 2024 @04:51PM (#41803458)
You should probably accompany this kind of claim with a code snippet to show what we're missing out on.
Re:JavaScript Structs by int_19h on Thursday October 10, 2024 @06:45PM (#41804344)
Useful for what?