|
|
|
|
|
by yoha
3493 days ago
|
|
Decrementing loops is the one place where I have indulged in some trickery. I do: for (size_t i = 9; i --> 0; )
This has the advantage to be very easy to pattern-match once known. Obviously, for a beginner, I would just do: for (int i = 9; i >= 0; i -= 1)
|
|
The fewer tricks and patterns you use in C, the higher chance actual bugs have of being caught. Cutesy tricks like "-->" confuse human analysis and gain nothing.