Re: Idiomatic Java: inverted conditions

2009-10-27 Thread Oliver Deakin
Jesse Wilson wrote: Harmony Team, Continuing along with a theme, there's another C/C++ism in our Java code that frustrates me. Our Java code frequently inverts conditions from their natural language form. From HttpURLConnectionImpl: if (null == resHeader) {

Re: Idiomatic Java: inverted conditions

2009-10-27 Thread Tim Ellison
On 26/Oct/2009 21:57, Jesse Wilson wrote: Continuing along with a theme, there's another C/C++ism in our Java code that frustrates me. Our Java code frequently inverts conditions from their natural language form. I'm sure we all have our own horror stories. The ones that make me cringe are

Re: Idiomatic Java: inverted conditions

2009-10-27 Thread Xiao-Feng Li
On Tue, Oct 27, 2009 at 6:51 PM, Tim Ellison t.p.elli...@gmail.com wrote: On 26/Oct/2009 21:57, Jesse Wilson wrote: Continuing along with a theme, there's another C/C++ism in our Java code that frustrates me. Our Java code frequently inverts conditions from their natural language form. I'm

Re: Idiomatic Java: inverted conditions

2009-10-27 Thread Tim Ellison
On 27/Oct/2009 13:35, Xiao-Feng Li wrote: On Tue, Oct 27, 2009 at 6:51 PM, Tim Ellison t.p.elli...@gmail.com wrote: On 26/Oct/2009 21:57, Jesse Wilson wrote: Continuing along with a theme, there's another C/C++ism in our Java code that frustrates me. Our Java code frequently inverts conditions

Re: Idiomatic Java: inverted conditions

2009-10-27 Thread Chris Gray
On Tue, 27 Oct 2009 14:21:14 +, Tim Ellison t.p.elli...@gmail.com wrote: On 27/Oct/2009 13:35, Xiao-Feng Li wrote: On Tue, Oct 27, 2009 at 6:51 PM, Tim Ellison t.p.elli...@gmail.com wrote: On 26/Oct/2009 21:57, Jesse Wilson wrote: Continuing along with a theme, there's another C/C++ism in

Idiomatic Java: inverted conditions

2009-10-26 Thread Jesse Wilson
Harmony Team, Continuing along with a theme, there's another C/C++ism in our Java code that frustrates me. Our Java code frequently inverts conditions from their natural language form. From HttpURLConnectionImpl: if (null == resHeader) { resHeader = new Header();

Re: Idiomatic Java: inverted conditions

2009-10-26 Thread Alexey Petrenko
The construction which kills me is: if some string.equals(str) instead of if str.equals(some string) But unfortunately the first form is better then second one :) Alexey 2009/10/27 Jesse Wilson jessewil...@google.com: Harmony Team, Continuing along with a theme, there's another C/C++ism in

Re: Idiomatic Java: inverted conditions

2009-10-26 Thread Mark Hindess
In message a43fbc6a0910261457r73912ed5k70e90e558908b...@mail.gmail.com, Jesse Wilson writes: Harmony Team, Continuing along with a theme, there's another C/C++ism in our Java code that frustrates me. Our Java code frequently inverts conditions from their natural language form. From

Re: Idiomatic Java: inverted conditions

2009-10-26 Thread sebb
On 26/10/2009, Alexey Petrenko alexey.a.petre...@gmail.com wrote: The construction which kills me is: if some string.equals(str) instead of if str.equals(some string) But unfortunately the first form is better then second one :) Surely it's only better if the str variable can be null?