3 ms·
> (In the last case, the exact order in which the 45 iterations happen should maybe be left unspecified; at any rate, it would be bad style to depend on it.) R
by kazinator 7y ago
> (In the last case, the exact order in which the 45 iterations happen should maybe be left unspecified; at any rate, it would be bad style to depend on it.)
Relying on something unspecified isn't just bad style; it's a bug.
Why would you introduce requirements into a higher level language that leave important aspects unspecified, opening the door to bugs?
- gjm11 7y agoSorry, I wasn't clear enough. I meant: 1. It might be best not to specify what happens, because 2. if it were specified then people would rely on the specific order, which would be bad style because it would make code harder to read and be more liable to errors if anyone misremembers what order the iteration happens in. (But it's true that people might rely on the observable behaviour even if it weren't officially specified, and that would be even worse. Which is why I said "should maybe be left unspecified"; it isn't obvious to me which way is better overall. If it's unspecified then fewer people will rely on it but the consequences each time will be worse.)