3 ms·
That can cut both ways. Sometimes optimizations reduce legibility even for advanced programmers, and often for very marginal improvements in performance...or no
by darksaints 5y ago
That can cut both ways. Sometimes optimizations reduce legibility even for advanced programmers, and often for very marginal improvements in performance...or no improvement in performance at all because they're not on the critical path. Sometimes it's okay to make code slower but more obvious as to what it is doing.
- hinkley 5y agoVariable hoisting can make a loop faster and the intentions clearer. As long as you don’t hoist the variable entirely off the page, that is. Declaring at the top of a large scope is confusing. I think people got that from older versions of C as I recall. It’s worse than doing nothing.