Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^5: When every microsecond counts: Parsing subroutine parameters

by Joost (Canon)
on May 18, 2008 at 00:58 UTC ( [id://687167]=note: print w/replies, xml ) Need Help??


in reply to Re^4: When every microsecond counts: Parsing subroutine parameters
in thread When every microsecond counts: Parsing subroutine parameters

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.

  • Comment on Re^5: When every microsecond counts: Parsing subroutine parameters

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://687167]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-16 13:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found