harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: Idiomatic Java: inverted conditions
Date Tue, 27 Oct 2009 10:51:06 GMT
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 structured like this,

public void foo(Object bar) {

  if (bar != null) {
    ...
    <some long method, typically /too/ long>
    ...
    return result;
  }

  throw IllegalArgumentException();

}

Grrr.

Tim

Mime
View raw message