r/programming • • Jun 09 '16

jQuery 3.0 Released!

https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/
1.1k Upvotes

354 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Jun 10 '16

in client work, how often is forEach actually an issue? use the most succing code then take a quick look at the profile against a large set of data.

for less code, easier to read, and of course if isn't causing jank, it makes sense to go with forEach.

0

u/[deleted] Jun 10 '16

[deleted]

1

u/Benmjt Jun 10 '16

Succinct, maybe?

1

u/[deleted] Jun 10 '16

Succinct. Phone shit.

2

u/EternalNY1 Jun 10 '16

use the most succing code then take a quick look at the profile against a large set of data.

I would say, always ... write the most READABLE code that you still feel is performant, then profile it. If it's fine from an overall performance standpoint, you are good.

That's it! It's not rocket science (well, it might be, but usually not if we're talking about things like JavaScript).

You don't even need to comment it! It just makes sense from looking at it and is fine. Who cares if it's 3 ms slower than the other version that is 10 lines longer? If that is not impacting your users, move on.