3 ms·
> This is (or was) deliberate, with the rationale being that it makes O(n) blocks of code trivial to identify in review. Like how for (int i = 0; i < strl
by azth 7y ago
> This is (or was) deliberate, with the rationale being that it makes O(n) blocks of code trivial to identify in review.
Like how
for (int i = 0; i < strlen(str); i++) { ... }
is O(n)?
- coldtea 7y agoLet's give them the benefit of the doubt, and consider that they meant that: for (int i = 0; i < strlen(str); i++) { ... } could be grepped and easily discerned from: for (int i = 0; i < str_length; i++) { ... } and generally, that every looping point could be easily identified. After all, if you call functions inside the body, all bets are off as to what complexity the loop means anyway...