If you want to figure out what code does, run it. Then read on operators and try to figure out how that happened.
If you read on ternary operator, you will know that part between ? and : behaves as if it was inside brackets (precedence of inner operators has no relation on behavior outside this part): someValue ? (++x, ++y) : --x, --y Then, because comma has lower precedence rest of code parsed as: (someValue ? ++x, ++y : --x), --y
So, depending on value of somevalue it either increments both x and y or decrements x. Then it unconditionlly decrements y.
Another example why ternary operator should not be abused like that: it is easy to misread it — your code does not do what original does.
It is actually: