On Wed, Feb 22, 2017 at 10:27:33AM -0500, Benjamin Smedberg wrote:
> On Thu, Feb 16, 2017 at 4:47 PM, wrote:
>
> > Question of the day:
> > When breaking overlong expressions, should &&/|| go at the end or the
> > beginning of the line?
> >
> > TL;DR: Coding style says
On Sun, Feb 19, 2017 at 8:07 PM, Martin Thomson wrote:
> On Mon, Feb 20, 2017 at 3:18 AM, smaug wrote:
> > I don't care too much about &&/|| coding style, though the current style
> > does feel easier to
> > read, per the reasoning dmajor gave.
>
> I suspect
On Mon, Feb 20, 2017 at 3:18 AM, smaug wrote:
> I don't care too much about &&/|| coding style, though the current style
> does feel easier to
> read, per the reasoning dmajor gave.
I suspect that a lot of people think this way. While it's tempting to
suggest that arguments
On 02/18/2017 07:08 PM, Eric Rescorla wrote:
I'd also note that if we're not going to use "this is what we have done
historically"
as a guide, then it seems like much bigger changes are on the table and we
would probably be better off adopting some other well-defined coding
standard
wholesale
On 2017-02-16 18:21, Jean-Yves Avenard wrote:
>
>
> On 17/02/17 00:17, Jeff Gilbert wrote:
>> If there are so many parens that we require an editor to disambiguate
>> them, it's too dense. Add whitespace or decompose the expression until
>> readable.
>>
> I'd love to know how adding any
> On Feb 17, 2017, at 6:24 PM, ISHIKAWA,chiaki wrote:
>
> Point 2:
> I prefer all the operators including "&&" and "||"
> at the beginning since such a format makes the tree-like structure of
> multi-line easier to understand and edit, too.
> Adding a condition or
On 17/02/17 23:18, gsquel...@mozilla.com wrote:
Hi again Nick,
Someone made me realize that I didn't fully read your message, sorry for that.
I now see that as well as &&/||, you have grepped for other operators, and
shown that the overwhelming usage is to put all of them at the end of
On Saturday, February 18, 2017 at 10:50:24 AM UTC+11, Boris Zbarsky wrote:
> On 2/17/17 5:44 PM, gsqu...@mozilla.com wrote:
> > - People who stick with the official parser will only ever see that
> > (pushing to mozreview will reformat everything to the official style).
>
> Not all reviews go
On 2017/02/18 7:28, Bobby Holley wrote:
On Fri, Feb 17, 2017 at 2:18 PM, wrote:
Hi again Nick,
Someone made me realize that I didn't fully read your message, sorry for
that.
I now see that as well as &&/||, you have grepped for other operators, and
shown that the
On 2/17/17 5:44 PM, gsquel...@mozilla.com wrote:
- People who stick with the official parser will only ever see that (pushing to
mozreview will reformat everything to the official style).
Not all reviews go through mozreview.
-Boris
___
After dealing with bugs that only happen in PGO builds, I would be worried
about bugs in the code-formatting-rewriter. The value doesn't seem worth
the risk to me.
- jared
On Fri, Feb 17, 2017 at 5:44 PM, wrote:
> On Saturday, February 18, 2017 at 9:29:06 AM UTC+11,
On Saturday, February 18, 2017 at 9:29:06 AM UTC+11, Bobby Holley wrote:
> On Fri, Feb 17, 2017 at 2:18 PM, wrote:
>
> > Hi again Nick,
> >
> > Someone made me realize that I didn't fully read your message, sorry for
> > that.
> >
> > I now see that as well as &&/||, you
On Fri, Feb 17, 2017 at 2:18 PM, wrote:
> Hi again Nick,
>
> Someone made me realize that I didn't fully read your message, sorry for
> that.
>
> I now see that as well as &&/||, you have grepped for other operators, and
> shown that the overwhelming usage is to put all of
Hi again Nick,
Someone made me realize that I didn't fully read your message, sorry for that.
I now see that as well as &&/||, you have grepped for other operators, and
shown that the overwhelming usage is to put all of them at the end of lines!
In light of this, and from what others here have
On Thu, Feb 16, 2017 at 11:39 PM, David Major wrote:
> One thing I like about trailing operators is that they tend to match
> what you'd find in bullet-point prose. Here's a made-up example:
>
> You can apply for a refund of your travel insurance policy if:
> * You cancel
On Fri, Feb 17, 2017 at 5:28 PM, wrote:
> Of course grepping agrees with you, since it's been the coding style so
> far! ;-)
> I was hoping to change that, if most people agreed.
>
Isn't the current style that && and || go at the end but other operators go
at the start?
One thing I like about trailing operators is that they tend to match
what you'd find in bullet-point prose. Here's a made-up example:
You can apply for a refund of your travel insurance policy if:
* You cancel within 7 days of purchase, and
* You have not yet begun your journey, and
* You have
Of course grepping agrees with you, since it's been the coding style so far! ;-)
I was hoping to change that, if most people agreed.
While it's good to know how many people are for or against it, so that we get a
sense of where the majority swings, I'd really like to know *why* people have
I personally have a strong preference for operators at the end of lines.
The codebase seems to agree with me, judging by some rough grepping ('fff'
is an alias I have that's roughly equivalent to rgrep):
$ fff "&&$" | wc -l
28907
$ fff "^ *&&" | wc -l
3751
$ fff "||$" | wc -l
26429
$ fff
On Fri, Feb 17, 2017 at 10:39 AM, Robert O'Callahan
wrote:
>> Using clang-format on the entire tree has the massive value of:
>
> Also, it's very liberating not having to think about formatting while
> writing code, knowing it will be automatically fixed up later. This is
>
Thank you David.
Your opinion about any *future* change to &&/|| style would be appreciated. ;-)
About "increased disruption to blame that makes understanding the history of
our code harder":
I think some tools like http://searchfox.org/ have considerably lessened the
impact to blame, because
On Fri, Feb 17, 2017 at 12:25 PM, L. David Baron wrote:
> Using clang-format on the entire tree has the massive value of:
>
> * reviewers not needing to point out whitespace and indentation issues
>
> * reduced friction for new contributors (being able to use a tool
>
I'll not get into why I disagree with your points about
format-the-world here. Let's leave that for elsewhere.
Here's my take on the example at hand:
https://pastebin.mozilla.org/8979527
In this case, I do like the latter two best. (Old-style and simplification)
On Thu, Feb 16, 2017 at 3:25 PM,
On Thursday 2017-02-16 15:11 -0800, Jeff Gilbert wrote:
> I would not assume that's necessarily going to happen without
> contention. Consistency is not a goal in and of itself.
Using clang-format on the entire tree has the massive value of:
* reviewers not needing to point out whitespace and
Jeff, I see you're opinionated against consistency. :-)
Or you think there are other more important things?
Anyway, I'm not exactly sure what you're advocating. Could you please elaborate?
On Friday, February 17, 2017 at 10:11:25 AM UTC+11, Jeff Gilbert wrote:
> I would not assume that's
If there are so many parens that we require an editor to disambiguate
them, it's too dense. Add whitespace or decompose the expression until
readable.
On Thu, Feb 16, 2017 at 3:15 PM, Mike Hommey wrote:
> On Fri, Feb 17, 2017 at 12:10:32AM +0100, Jean-Yves Avenard wrote:
>>
On Fri, Feb 17, 2017 at 12:10:32AM +0100, Jean-Yves Avenard wrote:
> reading this: (turn on courier)
>
> return ((aCodecMask & VPXDecoder::VP8)
> && aMimeType.EqualsLiteral("video/webm; codecs=vp8"))
> || ((aCodecMask & VPXDecoder::VP9)
> &&
Both are readable with judicious indentation on wrapping. If you must
recompose the entire expression in your mind, the code is too terse,
and we should consider cleaning it up and making it more readable.
&&/|| position will not make or break this.
On Thu, Feb 16, 2017 at 3:10 PM, Jean-Yves
I would not assume that's necessarily going to happen without
contention. Consistency is not a goal in and of itself.
On Thu, Feb 16, 2017 at 3:04 PM, wrote:
> There's an ongoing effort to use clang-format to automatically format All The
> Codes [1], so I think we should
Hi
On 16/02/17 23:56, Jeff Gilbert wrote:
I don't visually like ||/&& at start of line, but I can't fault the
reasoning, so I'm weakly for it.
I don't think it's important enough to change existing code though.
Disclaimer: I'm now biased about this.
I've been writing C and C++ code for now
There's an ongoing effort to use clang-format to automatically format All The
Codes [1], so I think we should try and make sure we agree (or at least
settle*) on a coding style when it's going to be enforced everywhere. ;-)
* I'm presenting my own preferences here, but in the end I'm fine with
I don't visually like ||/&& at start of line, but I can't fault the
reasoning, so I'm weakly for it.
I don't think it's important enough to change existing code though.
On Thu, Feb 16, 2017 at 1:47 PM, wrote:
> Question of the day:
> When breaking overlong expressions,
Question of the day:
When breaking overlong expressions, should &&/|| go at the end or the beginning
of the line?
TL;DR: Coding style says 'end', I think we should change it to
'beginning' for better clarity, and consistency with other operators.
Our coding style reads:
"Break long conditions
33 matches
Mail list logo