Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: blmblm@myrealbox.com Newsgroups: comp.lang.java.programmer Subject: Re: About java program. Date: 15 Jul 2013 20:20:36 GMT Organization: None Lines: 26 Message-ID: References: <324f929f-772e-4004-81e1-6b454cdae794@googlegroups.com> X-Trace: individual.net MDJN/afKmAKFrvrD8vseSw6cIvMVYs8FAoFIK2ncPzwphSZt1M X-Orig-Path: not-for-mail Cancel-Lock: sha1:IBfeOIuEKWGe18o/GtOjbUhXTBw= X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: csiph.com comp.lang.java.programmer:24744 In article , Robert Klemme wrote: > On 20.06.2013 10:23, Sven Köhler wrote: > > Am 19.06.2013 22:20, schrieb Robert Klemme: [ snip ] > > And may all (ex-)C programmers in this group refrain from telling me > > that not initializing variables is dangerous. This is Java, where the > > compiler enforces initialization of variables on all code paths before > > the first read-access to the variable. > > Exactly. And another difference to C is that you can declare variables > anywhere - not just at the top of the method body. Well, you can do that in C too, if you use a compiler that supports standards later than C89. Just sayin'. (And late to the party, as usual.) > I have seen too many > Java methods which did that and used the variable 30 lines below. That > really makes reading and understanding code hard. -- B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.