Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Carlos Garcia Campos
El jue, 27-04-2017 a las 16:06 -0700, JF Bastien escribió: > Hello C++ fans! > > The C++ style check currently say: > Tests for true/false, null/non-null, and zero/non-zero should all be > done without equality comparisons > > I totally agree for booleans and pointers… but not for integers. I >

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Michael Catanzaro
On Thu, Apr 27, 2017 at 6:33 PM, Chris Dumez wrote: I also do not like this rule when it comes to integers. I personally think JF’s proposal to allow == 0 sounds nice. I don’t think JF was suggesting rewriting existing code (which would indeed cause a lot of churn). Yup.

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Simon Fraser
+1 for ! liking ! when testing numeric values against zero. Simon > On Apr 27, 2017, at 4:33 PM, Chris Dumez wrote: > > I also do not like this rule when it comes to integers. > > I personally think JF’s proposal to allow == 0 sounds nice. I don’t think JF > was suggesting

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Keith Miller
I agree that using ! does not make the code more readable. I almost always find ! subtly harder to read. Keith > On Apr 27, 2017, at 4:36 PM, Caio Lima wrote: > > O also think it's a good notation. It helps a lot the code reading IMO. > > Caio. > Em qui, 27 de abr de

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Dan Bernstein
> On Apr 27, 2017, at 4:36 PM, Geoffrey Garen wrote: > >>> On Apr 27, 2017, at 16:30, Geoffrey Garen >> > wrote: >>> >>> I’ve never really liked this style rule, and I’ve always felt like it snuck >>> into the style document

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Geoffrey Garen
>> On Apr 27, 2017, at 16:30, Geoffrey Garen > > wrote: >> >> I’ve never really liked this style rule, and I’ve always felt like it snuck >> into the style document without much discussion. > > It date from 2009:

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Caio Lima
O also think it's a good notation. It helps a lot the code reading IMO. Caio. Em qui, 27 de abr de 2017 às 20:33, Chris Dumez escreveu: > I also do not like this rule when it comes to integers. > > I personally think JF’s proposal to allow == 0 sounds nice. I don’t think > JF

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Chris Dumez
I also do not like this rule when it comes to integers. I personally think JF’s proposal to allow == 0 sounds nice. I don’t think JF was suggesting rewriting existing code (which would indeed cause a lot of churn). --  Chris Dumez > On Apr 27, 2017, at 4:30 PM, Geoffrey Garen

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread JF Bastien
> On Apr 27, 2017, at 16:30, Geoffrey Garen wrote: > > I’ve never really liked this style rule, and I’ve always felt like it snuck > into the style document without much discussion. It date from 2009: https://bugs.webkit.org/show_bug.cgi?id=27333

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Geoffrey Garen
I’ve never really liked this style rule, and I’ve always felt like it snuck into the style document without much discussion. Even so, I usually tolerate it. Geoff > On Apr 27, 2017, at 4:06 PM, JF Bastien wrote: > > Hello C++ fans! > > The C++ style check currently say:

Re: [webkit-dev] !!Tests for equality comparison

2017-04-27 Thread Filip Pizlo
I think that this aspect of the style - its implications for ints - was deliberate. The code uses the !int style in so many places that this style change would be a lot of churn for little benefit. I eventually got used to this style, and now it feels pretty natural. -Filip > On Apr 27,

[webkit-dev] !!Tests for equality comparison

2017-04-27 Thread JF Bastien
Hello C++ fans! The C++ style check currently say: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons I totally agree for booleans and pointers… but not for integers. I know it’s pretty much the same thing, but I it takes me slightly longer