Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Everybody shits on for loops until you need an increment other than 1.
I do like the new collections for loop in C++. Ranges are even better. -
retoor31361dWhen writing a languance, it's quite an annoying one to implement. But in one interpreter it went flawless, that was the moment i thought "now is my design ok".
-
As shit as PHP can be, the foreach one is quite nice (a few other languages have similar too)
-
-
Lensflare1812814h@MammaNeedHummus some languages even only have the foreach loop and not the classic for loop (it’s called just 'for' there).
Because for the extremely rare case that you really need the classic for, you can easily use foreach with int-ranges. -
Salmakis6768h@Lensflare i srsly experienced senior devs that where not able to understand for i loops.
-
@Salmakis what are "for i" loops?
To clarify what I mean by classical for loops:
for(int i=0; i<10; i++)
What I mean by modern for-each style loops:
for(i in 0..10) -
Salmakis6767hI mean that classical, index based loops.
The second one would i never use when i got an index, but thats just because im old.
standard for loop syntax is super ugly.
random