Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Your use of assertions in Perl ?

by dragonchild (Archbishop)
on Sep 06, 2008 at 02:40 UTC ( [id://709439]=note: print w/replies, xml ) Need Help??


in reply to Your use of assertions in Perl ?

This is how Catalyst's chained dispatch works (q.v. Catalyst::DispatchType::Chained). I always thought it was just sane.

As for assertions, I read a blog post recently where the author asserted that sane code generally had less else-clauses than otherwise. I've been looking at my code in that light and the code I find to be better has that property. I have a lot of unless-blocks of the form:

sub foo { my $self = shift; my %args = @_; # Lots of these unless ( ... ) { return; } # Do the real thing }
Same thing, right?

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://709439]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-03-28 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found