Re: Cleaning up the code [Was: Re: Cayenne/Windows developer help]

From: Kevin Menard (kmenar..ervprise.com)
Date: Thu Mar 02 2006 - 14:10:20 EST

  • Next message: Cris Daniluk: "Re: Cleaning up the code [Was: Re: Cayenne/Windows developer help]"

    I guess that would require us to standardize a coding style. I know we
    have the eclipse prefs, but I think Checkstyle gives you a lot more
    control.

    So, while I'm not ready to write all of these out, I was wondering what
    the concensus on something like the following is:

    public Thing blah()
    {
            if (whatever)
            {
                    return something;
            }
            else
            {
                    return anotherthing;
            }
    }

    I personally feel the else should be removed. But, that's because I
    normally get fooled by such things. In my mind, it's easier to consider
    whatever to be a special case and thus it goes in the if() while the else
    body is the regular case (and there's no need to assert it). I'm asking
    because there's a lot of cases similar to this in the code. If others
    agree with me, I'll go through and clean it up. Otherwise, I can cope
    with the existing style.

    -- 
    Kevin
    

    On Thu, 02 Mar 2006 12:45:10 -0500, Cris Daniluk <cris.danilu..mail.com> wrote:

    > One thing that may be helpful is to setup PMD and Checkstyle... both > require extensive configuration to eliminate annoying false positives, > but when tuned, they usually present helpful information. Obviously no > tool is perfect, but for us, about 25% of the reported PMD issues > deserved attention, and 75% of the checkstyle issues did. > > Maybe Findbugs would be a better choice than PMD... either way, I've > used PMD more for analytics, and checkstyle more for pure > style/formatting myself. > > Ideas? > > Cris



    This archive was generated by hypermail 2.0.0 : Thu Mar 02 2006 - 14:10:24 EST