Thought that was what I said...
Yes, but the general discussion (concerning C++) seemed broader,
at least to me. In Java, local variables are either pointers or
basic types; in C++, you have a lot more possibilities, and
"default initialization" can be a lot more complicated.
Not so. To run on the JVM, you have to make it past the Java
byte-code verifier. If the verifier required all local
variables to be initialized before access, then compilers
could not elide such initialization, even if they knew it were
safe to do so. The designers of Java made a conscious
decision not impose such a requirement, for reasons of
performance IIRC.
I don't know what the motivation of the Java designers was. All
I know was that performance doesn't make sense as a motivation
(which doesn't mean that it wasn't the motivation). Had the
designers required zero initialization, and dropped the
requirements for definite assignment, the compilers could have
generated exactly the same code as they do today---if your code
met the requirements of definite assignment, then the compiler
could detect it (since it is required today to detect it), and
drop the zero initialization. If your code didn't, then
according to today's rules, you would have to add an artificial
initialization, which shouldn't cost anything less (and could
cost more) than the compiler generated zero initialization. If
there is any difference in performance (and in most cases, I
don't think there will be), then requiring zero initialization
by the compiler will be faster than requiring definite
assignment.