4 ms·
>barring some philosophical code which cares about "zero-ness" But that is the intrinsic meaning OP was talking about. Plenty of mathmatics deals with 0 or 1 a
by thrwyoilarticle 6y ago
>barring some philosophical code which cares about "zero-ness"
But that is the intrinsic meaning OP was talking about. Plenty of mathmatics deals with 0 or 1 as important constants. If you have a function that mods by a parameter, you need error handling for zero. Calling it value_that_causes_undefined_behaviour isn't going to improve code clarity. Beyond that;
for (i = 0; i < IMPORTANT_QUANTITY; i++)
, or some variation thereof, is very idiomatic C.
- l0b0 6y agoMy point is, if you had to pull `0` in that `for` loop into a variable, would you call it `zero` or `first_index` (or something else actually relevant to the loop)? I'd certainly prefer something relevant to the loop rather than `zero`.