DEV Community

[Comment from a deleted post]
 
chenmike profile image
Mike Chen • Edited

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.

 
moopet profile image
Ben Sinclair

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.