Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
So, for not too much work, we get a way to not break method chaining, don't have to use eval {} to catch broken code, don't need exceptions, and it can fit into what we're already doing with all of our other objects.

Would you mind going into a little more detail as to why method chaining without exceptions should be done? Most likely, you will still

  • have to check the return value
  • have to figure out where in the chain things broke
  • have to handle that error somehow in some readable fashion
It sounds like a lot of work for the ability to have some admittedly very nice syntactic sugar.

Personally, I haven't ever seen the need for chaining methods like that. This may be because I haven't set my classes up in such a way as to provide for it, but wouldn't that be a more Perlish way of doing things? As Larry is quoted in the Cookbook, "The trick is to use Perl's strengths rather than its weaknesses." It sounds like you're trying to get another language's strength - method chaining - and shoehorning it into Perl without the infrastructure that goes along with it.

I'm just worried that this will be a maintenance nightmare. I would hate to come along as a consultant and be handed this stuff that uses chaining out the wazoo and tries to get cute with an AUTOLOADed everything object that overrides undef or falsehood and ...

See what I mean?

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.


In reply to Re: The Null Mull (or, when OO needs more O) by dragonchild
in thread The Null Mull (or, when OO needs more O) by brian_d_foy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-28 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found