There are very few cases where internal assignments reduce program complexity, for example, in if (x != null && y != null && ((c = f(x, y)) > 0) {...} , and you really only an assignment is needed when it is performed in a complex state.
But in most cases, internal assignments reduce readability and can be easily skipped.
I think that internal assignments are relict for the first versions of the C programming language in the seventies, when compilers did not do any optimizations, and the work on code optimization remained for programmers. At that time, internal assignments were faster because there was no need to read the value from the variable again, but today with fast computers and optimized compilers this point is no longer taken into account. Nevertheless, some C programmers were used for them. I think that Sun introduced internal assignments in Java only because they wanted to be like C and make it easier for C programmers to switch to Java.
Johanna
source share