It all comes down to convention, usually. People use what they know and are familiar with.
Typically, if you're writing an expression where the location of the increment operator makes a difference in the result, then I suspect that line of code is more likely to cause confusion and/or problems down the road. These lines should probably be split.
When many students first begin learning C or C++, they often feel that empty for loops are an "elegant" and/or "witty" solution to certain problems. In the real world, however, such cleverness is usually looked down upon in favor of readability.
For example:
for (int i = 0; i < 10; std::cout << i++);
should really be:
for (int i = 0; i < 10; ++i)
{
std::cout << i;
}
The second version, while it does take a lot more room, is much easier to understand at first glance. While it's possible to perform computation in the third section of a for expression, this place is really supposed to hold some sort of operation that will bring your iteration control variable closer to the stop condition.
Also, you'll notice that in the second code snippet, I use ++i as the incrementation variable. This is because it's *slightly* more efficient (unless you have a smart compiler). Because i++ is a post-increment operator, the compiler allocates space on the stack to hold the original value of i for use in the expression, and increments i in the original location.
Since there is no "rest of the expression", this extra allocation is not used for anything and therefore is just wasted space.
Again, many compilers can determine whether a post-incrementation operation is the entire expression and suppress the extra allocation in this case. But it's still handy to be explicit.
Take care,
Nik
http://www.bigaction.org/