Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: How to best pass on the context / wantarray?

by BerntB (Deacon)
on Mar 28, 2006 at 06:34 UTC ( #539632=note: print w/replies, xml ) Need Help??

in reply to Re: How to best pass on the context / wantarray?
in thread How to best pass on the context / wantarray?

I don't agree, since you blow up the size of the code. That makes it harder to work with quite often.

I had a similar problem once with a hobby project (don't ask).

There were states in a state engine, where the individual states were implemented as methods.

At the start of all the state methods there were some admin code (to unpack parameters) and also when returning (the return values were data structure that told the management system what to do with the next state).

The first part, the in parameter handling, became intolerable. Often the setup was half the code. I should have had some configuration that dynamically generated code, or munged the symbol table, or something.

The ugly extra at the return values were ok. Didn't even look that bad, in the end.

IMHO, what works best is a matter of taste, depending upon the code you add the extra lines to. (-: I would probably bet money that both you and Corion has better taste than me. :-)

  • Comment on Re^2: How to best pass on the context / wantarray?

Replies are listed 'Best First'.
Re^3: How to best pass on the context / wantarray?
by CountZero (Bishop) on Mar 28, 2006 at 19:14 UTC
    There is no accounting for taste!

    Strange enough I much like these (traditional) incantations at the beginning of subroutines and object-methods. It gives some kind of homely feeling.


    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://539632]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-02-20 12:33 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (271 votes). Check out past polls.