I agree that all things being equal performance should be important. Things are rarely equal though, and in this case I was making a point that I feel that readability matters much more in this situation.
Put another way: people are definitely going to have to read your array clearing code if you write it, so readability is going to be a concern. How many of these array clearing operations do you think it would take to make a noticeable difference in your app's performance? I feel like it would have to be millions.
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
I come from the generation where every byte counted and I know that optimisation sometimes seems like a lost art, but having something that you can understand without having to scratch your head for a second is more important in almost every situation.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I agree that all things being equal performance should be important. Things are rarely equal though, and in this case I was making a point that I feel that readability matters much more in this situation.
Put another way: people are definitely going to have to read your array clearing code if you write it, so readability is going to be a concern. How many of these array clearing operations do you think it would take to make a noticeable difference in your app's performance? I feel like it would have to be millions.
I come from the generation where every byte counted and I know that optimisation sometimes seems like a lost art, but having something that you can understand without having to scratch your head for a second is more important in almost every situation.