in reply to passing subroutine args as a hash: why not?

Seen as 61 arguments, the idea sounds more than faintly ludicrous. Seen as a function that processes a record containing 61 fields, maybe less so, provided that the hash is built automatically by some prior piece of code. If the coder has to build the hash either in-line, or specifically for the purposes of calling the sub, then it is ludicrous and should be refactored.

Maintaining such a record internally in the form of a hash mkes perfect sense. Passing the hash to the subroutine that processes it doesn't. Pass a reference to the hash. What waste all those cycles flattening a nicely structured hash into a list only to rebuild the list into a hash inside the sub?


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


  • Comment on Re: passing subroutine args as a hash: why not?