You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@bradym80 I was wondering the same thing. My assumption was that i = i + i is easier to understand since i++ requires some previous knowledge about this iterator. Not sure if there are some performance differences.
Anyway, I find i++ beautifully succinct and not tricky at all. :)
When you write these expressions as i = i + 1 it's clear what the intent of the programmer was and easier to find bugs in the code where as i++ prevents excess craftiness.
On line 35 of the for-loop pattern the following comment appears.
// optimization 3 - substitute
i++with
i = i + 1or
i += 1to avoid excessive trickiness
Could you elaborate on "excessive trickiness"?
The text was updated successfully, but these errors were encountered: