What do you think is the best, this:
or this?Code:test = (++test) % 10;
Code:test = (test +1) % 10;
It's not good practice to assign values to variables many times in the same expression(in the first example, we set test to be test+1, and we set test to be test+1 %10) . But I guess it's okay here, because the = operator is forcing the computation of (++test) %10, and then the test-variable is set to this value, so that it works as expected.
But this makes alternative 2 a more clear and nicer code, right?
EDIT: Changed from test++ to ++test.