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

From: Cris Daniluk (cris.danilu..mail.com)
Date: Thu Mar 02 2006 - 14:16:09 EST

  • Next message: Andrus Adamchik: "cayenne-jpa maven build system"

    Apache has some style guides, I think.... I recall not liking them
    much, though :)

    Are we bound to them? Obviously this is low priority stuff, but now
    that we have a lot more people actively participating, it does make
    sense to at least have going forward standards, kinda like what I'm
    working on for docs.

    On 3/2/06, Kevin Menard <kmenar..ervprise.com> wrote:
    > 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:16:10 EST