3 ms·
I'll make a case against. Declaring all your variables up-front means that _all_ variables can be altered from _every_ place in the function, making it a lot ha
by dinosaurdynasty 4y ago
I'll make a case against. Declaring all your variables up-front means that _all_ variables can be altered from _every_ place in the function, making it a lot harder to analyze/find data dependencies/etc.
Minimizing the scope of variables decreases the amount of scanning/grokking you have to do to find out how they are related. (Making them constant too also helps a lot as well... you know it won't change thereafter)