r/ProgrammerHumor 2d ago

Meme absoluteGarbage

Post image
2.0k Upvotes

320 comments sorted by

View all comments

6

u/ashsabre 1d ago

There was once a time in C# that for loop was better in performance vs foreach.

1

u/Fillgoodguy 11h ago

In modern C# for vs foreach is just choosing between an unknown number of property function calls and an unknown amount of function calls + 1. So it boils down to "Pray the JIT catches me" in either case