Let's see. How many of these languages do you think use named parameters at the call site?:
I can't really make sense of that sentence, but anyway programming is not a democracy, and it's still evolving fast enough that just counting languages won't give you meaningful insights.
I think that some time ago, someone found that they could do it. That a combination of Perl's syntax and hashes meant that it was possible. And kinda cute. And for complex constructors with lots of possible parameters, many optional, it makes a certain amount of sense. You mostly don't call heavy constructors in tight loops so there's no great harm in using it. For constructors.
AFAICT the big advantage of named parameters is that you can leave out the parts that default. This is great when you've got loads of options. And yes, most functions calls do not need a lot of options. But named options really do make a lot of sense whenever you've got two or more of them.
Mostly, it is just as hard to look up the naming and spelling and casing conventions of named parameters when writing the calls,
So what? Counting commas is no fun either. Also, a good IDE will help a lot there.
and just as hard to interpret the meaning of those names when reading them.
That's just bullshit.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|