The day after the first Wednesday of every month - was Re: London.pm Meeting - April 5th

David Cantrell david at cantrell.org.uk
Wed Mar 28 13:56:36 BST 2007


On Wed, Mar 28, 2007 at 08:36:40AM +0200, Luis Motta Campos wrote:
> On Mar 27, 2007, at 6:57 PM, Ash Berlin wrote:

> >$meeting = $today if $today->day eq 'Thursday' and $today- 
> >>dayOfMonth >= 2 and $today->dayOfMonth <= 8;
> Damian Conway says on Perl Best Practices that this is bad coding.

The only bad coding I see there is the omission of parentheses around
the condition, and that it needs reformatting to fit into a sensible
line length:

  $meeting = $today if(
      $today->day eq 'Thursday' &&
      $today->dayOfMonth >= 2 &&
      $today->dayOfMonth <= 8
  );

I replaced 'and' with '&&', because I *really* dislike 'and' and 'or' -
if you're worried about precedence, use parens instead of confusing the
reader with extra operators.

-- 
David Cantrell | Godless Liberal Elitist

      Googling for "Swedish lizard overlord" gives
      this sig as the first result.
      
      WHAT DOES THAT TELL YOU, EH? EH?


More information about the london.pm mailing list