I saw this style C programs. If I recall correctly the motivation
was to avoid something like 'if (foo = 3)' which will set foo to 3 and will
be considered
as 'true'.

Is this is still a problem with Java (assuming one avoids Boolean comparison
such as 'if (foo == true)') ?

BTW, we are avoiding problems like that (and many others) by declaring most
variable and all method arguments as 'final'. I wish IDEA would support this
style. Currently, when we generate constructors and setters, we need to fix
them manually.

Tal

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Thomas Singer
> Sent: Tuesday, November 20, 2001 5:24 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [Eap-features] Feature Request List
>
>
> At 22:24 20.11.01 +1100, you wrote:
> >On Tue, 20 Nov 2001 22:09, Thomas Singer wrote:
> > > >15. refactoring to place immutable/constant values in first
> position in
> > > >if()/while() etc expressions
> > >
> > > What do you mean?
> >
> >change "if( foo == 3 )" to "if( 3 == foo )"
>
> At least for me this looks terrible odd, because I /read/ code:
>
>   "if foo equals 3" sounds a lot better than "if 3 equals foo".
>
> but ore hard:
>
>   "if foo2 greater 3" vs. "if 3 smaller foo2"
>
> Tom
>
>
> _______________________________________________
> Eap-features mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-features


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to