3 ms·
You haven't given any reason why implicit initialization of variables is better than explicit. Explicit initialization is already required for any initial valu
by haberman 15y ago
You haven't given any reason why implicit initialization of variables is better than explicit. Explicit initialization is already required for any initial value except 0 and it conveys intention. It's not onerous -- it's 3 extra characters, and it makes it clear that you meant it to be zero (and you didn't just forget to initialize it).
I think the case for omitting "= 0" is weak at best. If you encourage this style some novice/intermediate programmer could do the same thing for a stack variable, which will bite him/her. Given all these costs/downsides, what is the benefit of not typing those three characters?