Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Code Style for CDT code

I am ok with braces rules proposed by Sergey
Regarding Java formatter, we are tools guys, lets fix Java formatter then. Sergey do you have bugs open for JDT?
I agree to set length to 132. Having length as 80 really does not work with DSF callbacks style (when we can switch to java 8 btw?).
But I personally would not enforce any of these rules above in code reviews.
The only real things I am concerned on code reviews are:
- copyright comments and general comments
- indentation of statements in the same code block (if I see indentation is off on code review screen I would not like to accept it, usually it is caused by mixing tabs and spaces)
- if somebody start using weird naming conventions (like c-style method name get_me_something_1)


On Tue, Jan 27, 2015 at 12:20 PM, Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx> wrote:


On Tue, Jan 27, 2015 at 9:01 AM, Greg Watson <g.watson@xxxxxxxxxxxx> wrote:

On Jan 27, 2015, at 11:07 AM, Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx> wrote:



On Tue, Jan 27, 2015 at 5:08 AM, Alena Laskavaia <elaskavaia.cdt@xxxxxxxxx> wrote:
Sorry to bring this up again, but I want to discuss this on cdt-dev.
Marc yet again -1'ed my commit because of code style, specifically because not surrounding
a single statement with braces within if operator. First of all I don't remember agreeing on any sort of code style like that (see cdt process and code style wiki), second of all I strongly disagree with this specific one. Coding style like that was created I think 20 years ago where people were
formatting code manually. Today everybody who works on cdt code should use auto-formatter.

Strongly disagree. JDT formatter is buggy and is being rewritten as part of https://bugs.eclipse.org/bugs/show_bug.cgi?id=303519. ‘

This bug seems to be related to setting a line length of 80. Why would anyone want to do this is beyond me. I’ve been using the formatter for years (132 columns) and never had a problem.

A sure way to not have problems is to accept whatever formatter produces. It is true that some of us are more picky than others.
 
Maybe CDT should agree on a line length?

JDT formatter has multiple issues regardless of the value of the maximum line length. 


This should be the rule, not braces.

Formatter doesn't insert or remove braces, so it is suitable no normalize style related to them. For braces I propose the following rules:

But code cleanup will insert or remove braces.

It's not flexible enough to support the rules proposed in this thread. 

Greg

-sergey 


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top