On Wed, Sep 06, 2017 at 12:30:58PM -0700, Eric Rahm wrote: > Hi folks- > > *Note: Previously we've discussed the placement of logical operators && and > ||; a decision was made and I do not wish to re-litigate that here*. > > Currently we have a somewhat convoluted set of rules about where to place > boolean operators when breaking long lines [1]. Essentially we say that > logical operators such as `&&` stay at the end, but boolean opertators such > as `>` move to the new line. It's possible I'm misreading that (others > certainly have [2]). > > This is incompatible with tools like clang-format [3] which support either > leaving the operator at the end of the line or moving it to the new line, > but not a half and half approach. It is very unlikely we could convince > them to upstream such a change given we are the only organization that has > requested it. > > I would like to propose that we adjust our style guide to remove the > distinction between logical operators and boolean operators for the purpose > of line breaking and use a unified style. > > *Examples* > > Current rules: > > if ((aArgument == 100) && > (anotherReallyLongArgument > > 2000)) { > > Proposed change if we unify the rules, favoring the logical operator > placement: > > if ((aArgument == 100) && > (anotherReallyLongArgument > > 2000)) {
On a personal note, I find > 2000 as in the first sample more readable than the latter. So much so that I'd actually prefer the logical operators to be on the next line than boolean operator being on the previous. Mike _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform