44 ms·
> but there's absolutely no reason to use var any more Naw, var has function scope and hoisting, both of which are useful.
by thot_experiment 2y ago
> but there's absolutely no reason to use var any more
Naw, var has function scope and hoisting, both of which are useful.
- afavour 2y agoNot in a sensible codebase
- hinkley 2y agoMy 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.
- thot_experiment 2y agoSure and I'd accept the weaker claim that "there's no reason to use var in a production codebase touched by many people"
- yakshaving_jgt 2y ago> 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.
- hombre_fatal 2y agoYou should probably accompany this kind of claim with a code snippet to show what we're missing out on.
- int_19h 2y agoUseful for what?