in reply to Re^2: Adding attributes to values?
in thread Adding attributes to values?

Personally I'd much rather well documented named parameters with sensible defaults and parameter checking by the called code. Positional parameter passing is simply not attractive unless there is only one (or no) parameter.


Perl is environmentally friendly - it saves trees

Replies are listed 'Best First'.
Re^4: Adding attributes to values?
by oyse (Monk) on Oct 22, 2007 at 12:05 UTC

    I think positional parameters are ok if you are not passing more than 3 or 4 and you don't have any dummy parameters. What I consider to be ok also depends on if the function is used often or not. For rarely used functions I find that named arguments can often make the code more self-documenting. For functions that are used often I often prefer the less verbose style of positional parameter passing as long as the criteria above i met.

    But such things are matter of personal coding style. I want to create a module for parameter validation that lets the user of a function with parameter validation decide the appropriate calling style and the module author just worrying about writing the appropriate signature. If the module turns out to be any good I will post it as an RFC under Meditations.