in reply to Re: Confused.... question on code scalability (reusing functions, etc)
in thread Confused.... question on code scalability (reusing functions, etc)

Two minor and probably utterly useless nitpicks.
  1. I would suggest standardizing on which negator you are going to use. Not or !.
  2. You really don't need parens around every single item in an if statement. if(($foo) and (not($baz=~/qux/))) is surely much easier to read as if($foo and not $baz=~/qux/)

Replies are listed 'Best First'.
Re: Re: Re: Confused.... question on code scalability (reusing functions, etc)
by parv (Parson) on Feb 16, 2003 at 09:39 UTC

    About "standardizing on which negator you are going to use. Not or !."...

    ...that depends on the intent of expression evaluation. Word operators (not, and, or) bind rather loosely than otherwise (!, &&, ||). Just consider the output of the following...

    perl -e 'print join(" ", (!0 && 0) , (!0 and 0) , (not 0 && 0) , (not +0 and 0))'

    It is ill advised to ask a beginner to standardise on a negator, as you put it, without mentioning the operator precedence level.

Re: Re: Re: Confused.... question on code scalability (reusing functions, etc)
by Anonymous Monk on Feb 16, 2003 at 08:05 UTC
    BUU, Noted. Thanks ..... will definitely keep that in mind from now on. SP