I'm guessing the second one is an incomplete comparison operator, so the two objects are inserted at the same position, the second erasing the first one?
Nope. May I ask now, why the heck anyone would use postfix and not prefix ++ and -- operators? Don't give me any 'compiler optimization' stuff ;p
REAL men write code like this:
1 2 3 4
for(unsignedlong i = 0; i < number; ++i) //preincrement ftw
{
//
}
Anywho, I see a lot of people make this mistake with color codes: color = (0, 255, 128);
"Why does it only have a halfway red color?"
Usually from people new to programming and trying to write HLSL shaders.
They are different and can have different uses. Of course, if you just wnat to increment something, pre is faster. But the temporary used in the post can be handy.
I think it's a holdover from C back in the day. postfix makes more sense in that context, as manually iterating with a pointer is more common.
I'd see this code a lot: *foo++;, which to this day I have to stop and think about exactly what it's doing (*stabs people who don't use parenthesis*).
Anyway postfix makes sense in that [relatively common] situation, and prefix didn't make sense in as many situations. And if you're using postfix in one place, why not use it in every place to be consistent?
Though I agree that prefix should be preferred unless you have reason to use postfix.