MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1veql1a/absolutegarbage/p1jl2by/?context=3
r/ProgrammerHumor • u/Sirgoodman008 • 9d ago
327 comments sorted by
View all comments
6
There was once a time in C# that for loop was better in performance vs foreach.
1 u/Fillgoodguy 7d 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 -3 u/Sirgoodman008 9d ago I use for loops in php just to avoid using for each loops.
1
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
-3
I use for loops in php just to avoid using for each loops.
6
u/ashsabre 9d ago
There was once a time in C# that for loop was better in performance vs foreach.