Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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?
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.

    CountZero

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (16)
As of 2014-07-31 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (249 votes), past polls