"Jon Skeet [C# MVP]" <
[email protected]> a écrit dans le message de
(e-mail address removed)...
| Do you really use pre and post-increment operators *usually* in the
| context of a larger statement? I almost never do, because every time I
| do, it takes me longer to read the code afterwards than if I'd done:
|
| most_of_statement;
| i++;
I can see how using i++ or ++i as a single statement would behave
identically in as far as it achieved the same result and, not having
bothered to check the IL, assumed that any performance difference would have
to be so small as to be negligable.
The only occasion I could envisage a difference would be if the order of
value changing mattered, and on such an occasion, you might not have the
luxury of "tweaking" performance due to the integrity of the algorithm.
In either case, I really can't see any difference in performance being that
important in the scheme of things.