|
|
|
|
|
by Leherenn
1999 days ago
|
|
Honestly, I know it's minor, but when I tried Zig the fact I couldn't do the classic for loop to do a "for (int i = 0; i < n; ++i)" was quite annoying. It pollutes the scope, so you need to add scope braces every time, and I find it's much easier to forget the ++i at the end of the while loop. I understand where it's coming from, but having something like "for (i32 i in [0,n[)" would be so much nicer in my opinion. |
|
You can do:
or although the two have slightly different semantics (the latter would increment even after a break; the former wouldn't).