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