Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Code cleanup

I agree with the 132 line length: too much line wrapping without it.
I don't think sorting members is all that important since you can sort them in the outline view anyway
(and I'm sorry to say I didn't know that was in our developer guidelines, sorry.)
I agree that formatting changes committed at the same time as patches/changes/fixes can
make it very difficult to tell what's changed.

I'm not sure I agree with changing all the code at once.
>Another approach might be to update the source for individual plugins as they are being worked on, prior to committing any fixes.
I think that's more palatable, in that you're changing code that you're working on yourself.

The blanket use of the formatter doesn't always look great - can wrap line comments in a very ugly way.
It usually means some manual cleanup is in order, but that's hard to do for everything at once.

Just my two cents.
In general I vote for consistency and usability and readability over and above any particular style.
That is, I don't care whose style as long as we use one. Or at least aim at one.


...Beth

Beth Tibbitts
Eclipse Parallel Tools Platform http://eclipse.org/ptp
IBM STG Communications Protocols and Tools
Mailing Address: IBM Corp., Coldstream Research Campus, 745 West New Circle Road, Lexington, KY 40511

Inactive hide details for Greg Watson ---07/22/2010 09:16:44 AM---Hi Roland, I have the following additional clean up settings:Greg Watson ---07/22/2010 09:16:44 AM---Hi Roland, I have the following additional clean up settings:


From:

Greg Watson <g.watson@xxxxxxxxxxxx>

To:

Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>

Date:

07/22/2010 09:16 AM

Subject:

Re: [ptp-dev] Code cleanup

Sent by:

ptp-dev-bounces@xxxxxxxxxxx




Hi Roland,

I have the following additional clean up settings:

Convert control statement bodies to block
Convert for loops to enhanced for loops
Add final modifier to private fields
Add final modifier to local variables
Add missing '@Override' annotations to implementations of interface methods

I use a 132 character line length, as I find 80 characters results in too much line wrapping.

As far as I can tell, our formatting preferences are the same.

Assuming we agree on these, why not put the files on the wiki page to make it easy for people to use the same settings?

Regarding sorting members, I usually do this manually. I agree that it can make viewing changes more difficult (although some of the formatting changes can also do that). I don't have any objections if you want to change every source file, but it's going to be a big job. Another approach might be to update the source for individual plugins as they are being worked on, prior to committing any fixes.

Regards,
Greg

On Jul 22, 2010, at 1:16 AM, Roland Schulz wrote:

> Hi,
>
> according to
http://wiki.eclipse.org/PTP/developer_guidelines the members should be sorted but often they are not. Thus if people clean-up the code before submitting a patch or committing code, than the patch/commit is significant larger than the change itself. This makes reviewing the change much more difficult than it should be.
>
> Thus I suggest to clean-up the whole code in one go. And in case it is decided that currently is not a good moment to do this change, I would suggest temporarily remove the recommendation to sort-members of existing function until this change is made at a later point.
>
> It might be sufficient to only do the member sorting in one go. Other clean-up changes have less of an effect on the readability of patches. But
> I would suggest to also do the other clean-up changes in the same step.
>
> In this context, I would like to clarify what the recommended setting for formatter and clean-up are. Do we use 80 or 132 line-length?
> Greg asked me to use 132 in 315713 but I'm not sure whether it was meant only in that context or whether this is in general the recommendation.
>
> For the clean-up I use the default of:
> Change non static accesses to static members using declaring type
> Change indirect accesses to static members to direct accesses (accesses through subtypes)
> Remove unused imports
> Add missing '@Override' annotations
> Add missing '@Deprecated' annotations
> Remove unnecessary casts
> Remove unnecessary '$NON-NLS$' tags
> WITHOUT:
> Sort members excluding fields, enum constants, and initializers
> PLUS:
> Organize imports
> Format source code
> Remove trailing white spaces on all lines
> Correct indentation
>
> It this the recommended setting?
>
> I have attached the xml with the formatter and clean-up settings as described here in the text.
>
>
> Roland
>
>
> --
> ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
> 865-241-1537, ORNL PO BOX 2008 MS6309
> <cleanup.xml><formatter.xml>_______________________________________________
> ptp-dev mailing list
> ptp-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/ptp-dev

_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


GIF image

GIF image


Back to the top