Re: [all] Checkstyle and '+' should be on the previous line.

2012-09-04 Thread Mark Thomas


Gilles Sadowski gil...@harfang.homelinux.org wrote:

If you do find it ridiculous, it is indeed only because of habit;
others
might be used to (and thus prefer)

  y
  - x

Personally, I find:

a = y -
x;

easier to read than:

a = y
- x;

In the former I tend to miss that there isn't a ';' at the end of the line and 
that I need to read the next line to get the full story.

I agree that this is pretty much entirely personal habit and preference. Given 
that this has all the appearances of one of those style things that you are 
never going to get agreement from on Commons committers on, may I suggest that 
this is left to components to decide rather than being a commons-wide setting 
one way or the other.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [all] Checkstyle and '+' should be on the previous line.

2012-09-04 Thread Gilles Sadowski
Hi.

 
 If you do find it ridiculous, it is indeed only because of habit;
 others
 might be used to (and thus prefer)
 
   y
   - x
 
 Personally, I find:
 
 a = y -
 x;
 
 easier to read than:
 
 a = y
 - x;
 
 In the former I tend to miss that there isn't a ';' at the end of the line 
 and that I need to read the next line to get the full story.

That's a good point. Whatever the choice, there are advantages and drawbacks.

 
 I agree that this is pretty much entirely personal habit and preference.
 Given that this has all the appearances of one of those style things
 that you are never going to get agreement from on Commons committers on,
 may I suggest that this is left to components to decide rather than being
 a commons-wide setting one way or the other.

In the [Math] area of this list, we have a discussion about formalizing
certain rules. This has certainly not the purpose of having all the
components follow the same set of rules. I noted there that it would be nice
to have a uniform formatting style _per programming project_.


Best regards,
Gilles

 
 Mark

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [all] Checkstyle and '+' should be on the previous line.

2012-09-03 Thread Phil Steitz
On 9/1/12 10:11 AM, Gary Gregory wrote:

I have not tried using it, but the eclipse config that Luc posted
[1] includes this line, which I suspect configures this behavior:

setting
id=org.eclipse.jdt.core.formatter.wrap_before_binary_operator
value=false/

I am curious why you don't like it.  To me, it is similar to putting
the open paren for a method call on the preceding line.  Easier to
read for me at least.  Of course, in keeping with my normal too
many rules == evil view, I don't see it as something that needs to
be standardized :)

Phil

[1] http://markmail.org/message/djnlefeodk2xa7bz

 Hi All:

 Checkstyle can report warnings like:

 '+' should be on the previous line.

 FWIW, I'm not fond of this particular checkstyle rule.

 Does anyone know if the Eclipse formatter can be made to behave like this?
 I've not found such setting in the giant formatter options dialog. I am on
 Eclipse 3.7.2. Are there any 4.x users out there? If so, does 4.x deal with
 this?

 Thank you,
 Gary



-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [all] Checkstyle and '+' should be on the previous line.

2012-09-03 Thread Gilles Sadowski
On Mon, Sep 03, 2012 at 09:59:55AM -0700, Phil Steitz wrote:
 On 9/1/12 10:11 AM, Gary Gregory wrote:
 
 I have not tried using it, but the eclipse config that Luc posted
 [1] includes this line, which I suspect configures this behavior:
 
 setting
 id=org.eclipse.jdt.core.formatter.wrap_before_binary_operator
 value=false/
 
 I am curious why you don't like it.  To me, it is similar to putting
 the open paren for a method call on the preceding line.  Easier to
 read for me at least.  Of course, in keeping with my normal too
 many rules == evil view, I don't see it as something that needs to
 be standardized :)

One way to explain it: You would not write unary minus on the previous
line:
  double minusOne = -
1;

Similarly, before one has become used to this (arbitrary) rule, this is as
strange:
  double xMinusOne = x -
1;

[A rationale for writing parenthesis on the same line is that you can figure
out more quickly that it is a method call, rather than a reference to a
variable.]


Gilles

 
 Phil
 
 [1] http://markmail.org/message/djnlefeodk2xa7bz
 
  Hi All:
 
  Checkstyle can report warnings like:
 
  '+' should be on the previous line.
 
  FWIW, I'm not fond of this particular checkstyle rule.
 
  Does anyone know if the Eclipse formatter can be made to behave like this?
  I've not found such setting in the giant formatter options dialog. I am on
  Eclipse 3.7.2. Are there any 4.x users out there? If so, does 4.x deal with
  this?
 
  Thank you,
  Gary
 
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org
 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [all] Checkstyle and '+' should be on the previous line.

2012-09-03 Thread Gary Gregory
On Sep 3, 2012, at 14:13, Gilles Sadowski gil...@harfang.homelinux.org wrote:

 On Mon, Sep 03, 2012 at 09:59:55AM -0700, Phil Steitz wrote:
 On 9/1/12 10:11 AM, Gary Gregory wrote:

 I have not tried using it, but the eclipse config that Luc posted
 [1] includes this line, which I suspect configures this behavior:

 setting
 id=org.eclipse.jdt.core.formatter.wrap_before_binary_operator
 value=false/

 I am curious why you don't like it.  To me, it is similar to putting
 the open paren for a method call on the preceding line.  Easier to
 read for me at least.  Of course, in keeping with my normal too
 many rules == evil view, I don't see it as something that needs to
 be standardized :)

 One way to explain it: You would not write unary minus on the previous
 line:
  double minusOne = -
1;

That makes sense for unary guys at least.

G


 Similarly, before one has become used to this (arbitrary) rule, this is as
 strange:
  double xMinusOne = x -
1;

 [A rationale for writing parenthesis on the same line is that you can figure
 out more quickly that it is a method call, rather than a reference to a
 variable.]


 Gilles


 Phil

 [1] http://markmail.org/message/djnlefeodk2xa7bz

 Hi All:

 Checkstyle can report warnings like:

 '+' should be on the previous line.

 FWIW, I'm not fond of this particular checkstyle rule.

 Does anyone know if the Eclipse formatter can be made to behave like this?
 I've not found such setting in the giant formatter options dialog. I am on
 Eclipse 3.7.2. Are there any 4.x users out there? If so, does 4.x deal with
 this?

 Thank you,
 Gary



 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org


 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [all] Checkstyle and '+' should be on the previous line.

2012-09-03 Thread Phil Steitz




On Sep 3, 2012, at 12:25 PM, Gary Gregory garydgreg...@gmail.com wrote:

 On Sep 3, 2012, at 14:13, Gilles Sadowski gil...@harfang.homelinux.org 
 wrote:
 
 On Mon, Sep 03, 2012 at 09:59:55AM -0700, Phil Steitz wrote:
 On 9/1/12 10:11 AM, Gary Gregory wrote:
 
 I have not tried using it, but the eclipse config that Luc posted
 [1] includes this line, which I suspect configures this behavior:
 
 setting
 id=org.eclipse.jdt.core.formatter.wrap_before_binary_operator
 value=false/
 
 I am curious why you don't like it.  To me, it is similar to putting
 the open paren for a method call on the preceding line.  Easier to
 read for me at least.  Of course, in keeping with my normal too
 many rules == evil view, I don't see it as something that needs to
 be standardized :)
 
 One way to explain it: You would not write unary minus on the previous
 line:
 double minusOne = -
   1;
 
 That makes sense for unary guys at least.
 
Sort of ridiculous example, as the - would never be followed by a space, so 
would never be wrapped that way.  The rule above and I suspect the checkstyle   
 check, refers to binary operators. 

Phil

 G
 
 
 Similarly, before one has become used to this (arbitrary) rule, this is as
 strange:
 double xMinusOne = x -
   1;
 
 [A rationale for writing parenthesis on the same line is that you can figure
 out more quickly that it is a method call, rather than a reference to a
 variable.]
 
 
 Gilles
 
 
 Phil
 
 [1] http://markmail.org/message/djnlefeodk2xa7bz
 
 Hi All:
 
 Checkstyle can report warnings like:
 
 '+' should be on the previous line.
 
 FWIW, I'm not fond of this particular checkstyle rule.
 
 Does anyone know if the Eclipse formatter can be made to behave like this?
 I've not found such setting in the giant formatter options dialog. I am on
 Eclipse 3.7.2. Are there any 4.x users out there? If so, does 4.x deal with
 this?
 
 Thank you,
 Gary
 
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org
 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [all] Checkstyle and '+' should be on the previous line.

2012-09-03 Thread Gilles Sadowski
On Mon, Sep 03, 2012 at 02:19:01PM -0700, Phil Steitz wrote:
 
 
 
 
 On Sep 3, 2012, at 12:25 PM, Gary Gregory garydgreg...@gmail.com wrote:
 
  On Sep 3, 2012, at 14:13, Gilles Sadowski gil...@harfang.homelinux.org 
  wrote:
  
  On Mon, Sep 03, 2012 at 09:59:55AM -0700, Phil Steitz wrote:
  On 9/1/12 10:11 AM, Gary Gregory wrote:
  
  I have not tried using it, but the eclipse config that Luc posted
  [1] includes this line, which I suspect configures this behavior:
  
  setting
  id=org.eclipse.jdt.core.formatter.wrap_before_binary_operator
  value=false/
  
  I am curious why you don't like it.  To me, it is similar to putting
  the open paren for a method call on the preceding line.  Easier to
  read for me at least.  Of course, in keeping with my normal too
  many rules == evil view, I don't see it as something that needs to
  be standardized :)
  
  One way to explain it: You would not write unary minus on the previous
  line:
  double minusOne = -
1;
  
  That makes sense for unary guys at least.
  
 Sort of ridiculous example,

Perhaps you didn't get it...

 as the - would never be followed by a space,

And why not?

 so would never be wrapped that way.

Never?  I've just wrapped it that way. It's a valid expression, and not
using that notation is purely a result convention/rule/best practice/taste.

 The rule above and I suspect the checkstylecheck, refers to binary 
 operators. 

What's the point?

My point is that

  -
  x

is not more ridiculous than

  y -
x

If you do find it ridiculous, it is indeed only because of habit; others
might be used to (and thus prefer)

  y
  - x


Gilles

 
 Phil
 
  G
  
  
  Similarly, before one has become used to this (arbitrary) rule, this is as
  strange:
  double xMinusOne = x -
1;
  
  [A rationale for writing parenthesis on the same line is that you can 
  figure
  out more quickly that it is a method call, rather than a reference to a
  variable.]
  
  
  Gilles
  
  
  Phil
  
  [1] http://markmail.org/message/djnlefeodk2xa7bz
  
  Hi All:
  
  Checkstyle can report warnings like:
  
  '+' should be on the previous line.
  
  FWIW, I'm not fond of this particular checkstyle rule.
  
  Does anyone know if the Eclipse formatter can be made to behave like 
  this?
  I've not found such setting in the giant formatter options dialog. I am 
  on
  Eclipse 3.7.2. Are there any 4.x users out there? If so, does 4.x deal 
  with
  this?
  
  Thank you,
  Gary
  
  
  
  -
  To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
  For additional commands, e-mail: dev-h...@commons.apache.org
  
  
  -
  To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
  For additional commands, e-mail: dev-h...@commons.apache.org
  
  
  -
  To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
  For additional commands, e-mail: dev-h...@commons.apache.org
  
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org
 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [all] Checkstyle and '+' should be on the previous line.

2012-09-01 Thread Oliver Heger

Am 01.09.2012 19:11, schrieb Gary Gregory:

Hi All:

Checkstyle can report warnings like:

'+' should be on the previous line.

FWIW, I'm not fond of this particular checkstyle rule.

Does anyone know if the Eclipse formatter can be made to behave like this?
I've not found such setting in the giant formatter options dialog. I am on
Eclipse 3.7.2. Are there any 4.x users out there? If so, does 4.x deal with
this?


In Eclipse 4.2.0 there seems to be indeed a corresponding option: Under 
Line Wrapping, Expressions/Binary expressions (in the tree view), 
there is a checkbox Wrap before operator.


Oliver



Thank you,
Gary




-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org