Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: unused statics? Date: Fri, 25 Jan 2013 09:36:37 -0800 Organization: A noiseless patient Spider Lines: 34 Message-ID: <0fg5g85qrdb7hbfjq9ienml37cpuqp0cmo@4ax.com> References: <263f14ba-8542-4ec5-9e23-0a91da46e62d@googlegroups.com> <8cfbd2b9-1941-45d1-865b-1a7b5f9c515e@googlegroups.com> <51019d7f$0$291$14726298@news.sunsite.dk> <5101bec0$0$283$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="178318f439222c5a37153de8f1db0b76"; logging-data="31935"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0+EooAvXqNLRFQEExeZXYfsYtWAid260=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:NDAEAJw5jRIRRDZYklID/dMyCNo= Xref: csiph.com comp.lang.java.programmer:21707 On Thu, 24 Jan 2013 18:07:39 -0500, Arne Vajhøj wrote: [snip] >I think that it is easier to read code that are consistent >in initialization. Sure, but you are using a different sort of consistency. My consistency is to initialise as close to where the variable is used. If I need to change the initialisation for a section of code, it is right there. That said, I prefer to have my declarations near the related code. I dislike languages that require all declarations before all code in a block. >A class where all fields are initialized in declaration, >a class where all fields are initialized in constructor or a >class where all fields get default value is easy to understand >in my opinion. > >If 1/3 of fields are are initialized in declaration, 1/3 in >constructor and 1/3 get get default value then the reader will >spend the first 10 minutes trying to guess what the developers >reason for doing so is. If they are all initialised in declarations, then the reader will have to determine if that initialisation is really it. Sincerely, Gene Wirchenko