in reply to 'or' vs '', '&&' vs 'and'

Way to go starting a religious war :) Personally I use 'and' and 'or' for readability. Purists will no doubt point out the slight difference in precedence between the two forms, but for all practical purposes (AFAIK) there's no real difference.

rdfield

Replies are listed 'Best First'.
Re: Re: 'or' vs '', '&&' vs 'and'
by dws (Chancellor) on Apr 01, 2002 at 18:58 UTC
    Purists will no doubt point out the slight difference in precedence between the two forms, but for all practical purposes (AFAIK) there's no real difference.

    Anyone who is serious about programming will appreciate that "slight differences" can have significant consequences. Painting such people as "purists" says something sad about HFYK (how far you know).

Re: Re: 'or' vs '', '&&' vs 'and'
by demerphq (Chancellor) on Apr 02, 2002 at 13:58 UTC
    Actually I agree with dws. Getting into a habit of using either I think is probably a bad idea. I used the low precedence ones only until I got bitten by them, then I switched to the highe precedence once and got bitten again. Now I tend to try to be as careful and deliberate as possible, but I still occasionally screw it up.

    Little mental mantra: Parens are a symbol so use the symbols. No parens? Use the words.

    Yves / DeMerphq
    ---
    Writing a good benchmark isnt as easy as it might look.