As I said, I was hoping to avoid rehashing this point, but the general consensus from the last rather contentious post [1] was that changing from the prevalent style of the codebase for primarily aesthetic reasons was hard to justify (points about readability were made on both sides). Nick pointed out that our code base very clearly tilts to the operators on the end of the line style [2].
Carrying forward this wisdom for this case makes sense, but I'll admit moving everything to the newline is certainly an option that would provide a unified style which is my greater concern. I don't think we could reasonably make that change until some sort of flag day when we convert everything as the new style would clash with the prevalent style. I also don't want to start a discussion about that again :) -e [1] https://groups.google.com/d/msg/mozilla.dev.platform/LD_KCtmmH74/dLckkuFjBwAJ [2] https://groups.google.com/d/msg/mozilla.dev.platform/LD_KCtmmH74/ErPunKZ_BwAJ On Wed, Sep 6, 2017 at 5:18 PM, Mike Hommey <m...@glandium.org> wrote: > 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