Everyone provided good reasons for and against named arguments.

As for the how, I feel one thing is still missing: Params::Validate. This module has a nice way of defining very accurately what you need to get, and a little function that you simply feed your arguments to, and get back a proper data structure from.

It handles errors and all that.

When I work, given time, I use Params::Validate on classes that are subclassed heavily, or used by other people. I don't bother with it in the more "internal" classes while i'm working due to lack of time.

As the the actual style, I use non_capped_names because they're easiest to type. I've never had clashes with symbols, but for clarity I avoid reserved words (not that I haven't used any).

Ciao!

-nuffin
zz zZ Z Z #!perl

In reply to Re: named arguments by nothingmuch
in thread named arguments by spurperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.