|
|
|
|
|
by ninkendo
2513 days ago
|
|
This post reminded me that Perl doesn’t even have a concept of a method signature, even so much as showing the number of arguments. You have to look at the next few lines to hopefully see all the `... = shift;` lines to see what you’re actually supposed to send. I mean, a lack of type annotations is normal for a scripting language, but Perl always seemed to go a bit far by not even having a standard way of showing parameter names. I remember doing `my ($arg1, $arg2) = @_;` or something similar, but even that felt weird, and not everyone adopted that convention. |
|
There are shortcuts (just like you could write "doSometing() unless $var;"). Perl does give you options.
Python has different options for passing methods - passing variables, passing a dict,
P.S. while looking at python method declartions, you can send variables, a key-value, multiple keyvalue, and then there's this: https://stackoverflow.com/a/16785702
Which comes out with
Which is no more or less readable than the most confusing perl I've ever encountered."Cool Shortcuts" are a problem in any language. There are values in anonymous functions on occasion (especially in sorts), there should be a very compelling reason to do so.