Brent 'Dax' Royal-Gordon wrote:

Rod Adams <[EMAIL PROTECTED]> wrote:


The caller is not in a position to know if the callee is internally
structured in such a way that passing in a raw junction makes sense.


Sure
they are. It's called reading the documentation. If it doesn't say it can
handle junctions, it probably can't.



I don't want to have to stop in the middle of a hundred-line function
to think, "Does Store::Market.get act sanely when I give it a
junction? Do I need to explode it manually, or will it handle the
junction nicely on its own?"


You call functions where you don't know what data types they are expecting? That's... surprising.
Even in a loosely typed world like Perl, knowing what a sub or method is expecting to be fed seems like a good idea to me. I see checking for accepting junctions as input as being on the same level as "Does it want a list or an arrayref here?".


When I'm writing my own insanely large functions, I'm constantly hitting the docs to see the nuances about the method calls I'm not already intimately familiar with. And if I'm going to attempt to use a function in a new way (like feeding it a Junction), I recheck the docs to make sure I'm not setting myself up for trouble down the road.

Your mileage may vary.

-- Rod Adams.

(PS - This should not be construed to be an attack on you or your programming style. It is not. Though I've never seen you in action, I have every reason to believe you are a fully competent developer. It is simply a response to your statement above, explaining why I thought the attitude expressed there represented a weak argument.)





Reply via email to