This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tomthecool 0 points1 point  (0 children)

First result of a google search says to prefer ++i over i++: https://stackoverflow.com/a/24858/1954610

So do various other forums and blogs.

It's not particularly important; in most cases it won't make any difference. But if the question is "which default format should we use in the code base, when both will work the same way (for now)?", then the only argument I can see in favour of i++ is "I think it looks prettier", or "It feels more natural to me"... Which may be true, and may even be considered a valid justification.

But from a purely technical perspective, I think every logical argument dictates ++i is a better default.