Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] master e16500e: Fix check for NUL at the

From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Wed, 13 May 2015 10:08:59 +0100
On 13 May 2015 at 07:28, Bálint Réczey <balint@xxxxxxxxxxxxxxx> wrote:
2015-05-13 0:26 GMT+02:00 Guy Harris <guy@xxxxxxxxxxxx>:
>
> On May 12, 2015, at 3:13 PM, Evan Huus <eapache@xxxxxxxxx> wrote:
>
>> Argh, one of these days I will learn to just put parentheses in rather
>> than taking guesses at C operator precedence :(
>
> Yeah, the rule I've found works best for me is "if you aren't certain, throw parentheses at it".
Yes, in this case parentheses are a must.
I also llike putting them when the reader may not guess the precedence
correctly easily. This reader can be myself later ;-).

I have a colleague who for reasons only known to himself is violently against "unnecessary" parentheses, so I always put in even more just for him.

My rule is to parenthesise wherever multiple operators appear in an _expression_.  Even more important where the team is working in multiple programming languages with different precedence rules.


--
Graham Bloice