[jifty-devel] Janitorial: lib/Jifty/Request.pm

Eric Wilhelm scratchcomputing at gmail.com
Sat Mar 3 06:20:02 EST 2007


# from Jesse Vincent
# on Saturday 03 March 2007 02:06 am:

>> -- changed 'return undef' to bare 'return'.
>
>Ok. I know it's bad style, but I prefer "return undef". I should  
>probably be broken of this preference. (IE, I don't think there's a  
>need to go wioth my preference)

Well, aside from:

  if(my @list = $thing->method) {
    # oops, @list is (undef)

I use "return();", where the parens buy you a nice reminder in the form 
of a syntax error if you hadn't had the semicolon at the end of the 
block and then went to add something later, e.g.

    ...
    return
  }

Can too easily become:

    ...
    $a_condition and return
    my $foo = $self->something; # oops, didn't mean to return that
    ...
    return $foo
  }

If you always end a block with a semicolon, that won't bite you, but 
"always" always seems to not always be always.

--Eric
-- 
I arise in the morning torn between a desire to improve the world and a
desire to enjoy the world. This makes it hard to plan the day.
--E.B. White
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------


More information about the jifty-devel mailing list