Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #21707
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: unused statics? |
| Date | 2013-01-25 09:36 -0800 |
| Organization | A noiseless patient Spider |
| Message-ID | <0fg5g85qrdb7hbfjq9ienml37cpuqp0cmo@4ax.com> (permalink) |
| References | <263f14ba-8542-4ec5-9e23-0a91da46e62d@googlegroups.com> <8cfbd2b9-1941-45d1-865b-1a7b5f9c515e@googlegroups.com> <51019d7f$0$291$14726298@news.sunsite.dk> <oaSdnUTRN-cXOZzMnZ2dnUVZ_sKdnZ2d@earthlink.com> <5101bec0$0$283$14726298@news.sunsite.dk> |
On Thu, 24 Jan 2013 18:07:39 -0500, Arne Vajhøj <arne@vajhoej.dk>
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
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
unused statics? bob smith <bob@coolfone.comze.com> - 2013-01-24 12:23 -0800
Re: unused statics? Lew <lewbloch@gmail.com> - 2013-01-24 12:31 -0800
Re: unused statics? Arne Vajhøj <arne@vajhoej.dk> - 2013-01-24 15:45 -0500
Re: unused statics? Patricia Shanahan <pats@acm.org> - 2013-01-24 13:15 -0800
Re: unused statics? markspace <markspace@nospam.nospam> - 2013-01-24 13:54 -0800
Re: unused statics? Arne Vajhøj <arne@vajhoej.dk> - 2013-01-24 18:07 -0500
Re: unused statics? Lew <lewbloch@gmail.com> - 2013-01-24 17:16 -0800
Re: unused statics? Arne Vajhøj <arne@vajhoej.dk> - 2013-01-24 20:31 -0500
Re: unused statics? Arne Vajhøj <arne@vajhoej.dk> - 2013-01-24 20:35 -0500
Re: unused statics? Patricia Shanahan <pats@acm.org> - 2013-01-24 17:38 -0800
Re: unused statics? Magnus Warker <magnus@mailinator.com> - 2013-01-25 05:29 +0100
Re: unused statics? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-01-25 08:42 +0000
Re: unused statics? Gene Wirchenko <genew@telus.net> - 2013-01-25 09:36 -0800
Re: unused statics? Arne Vajhøj <arne@vajhoej.dk> - 2013-02-24 17:55 -0500
Re: unused statics? Arne Vajhøj <arne@vajhoej.dk> - 2013-01-24 15:43 -0500
Re: unused statics? Roedy Green <see_website@mindprod.com.invalid> - 2013-01-26 02:53 -0800
Re: unused statics? Arne Vajhøj <arne@vajhoej.dk> - 2013-01-26 16:37 -0500
csiph-web