News for hackers. Stuff that matters.
Re:How Perl Saved the Human Genome Project (1996) by PySlice on Sunday May 05, 2013 @01:41AM (#5657562)
What one can learn from Perl:

When programming in a language you hate, don't take naming arguments for granted. It could be worse: you could be programming in Perl, where all arguments come in a flattened array.

Re:How Perl Saved the Human Genome Project (1996) by kbenson on Sunday May 05, 2013 @04:35AM (#5657850)
This is really not much of an issue, if you bother to learn the language. If you don't, then yes, things will be confusing.

    sub named_params {
      my %P = @_; # named params in hash %P
      my $foo = $P{bar} + $P{baz};
      return $foo * $P{multiplier};
    }
    
    my $rvalue = named_params( foo => 1, bar => 2, multiplier => 3 );
Or, some people prefer to just pass in a hash reference:

    sub named_params_hashref {
      my $P = shift;
      my $foo = $P->{bar} + $P->{baz};
      return $foo * $P->{multiplier};
    }
    my $rvalue = named_params_hashref({
      foo => 1,
      bar => 2,
      multiplier => 3,
    });
But of course, why bother letting common sense, and a single line of code stand in the way of your chance to deliver a pithy remark?
Re:How Perl Saved the Human Genome Project (1996) by tudorconstantin on Sunday May 05, 2013 @02:50PM (#5659314)
just like in javascript - oh wait, that is the shiny new trend in programming, there it can't be bad thing the lack of named params.
Re:How Perl Saved the Human Genome Project (1996) by berntb on Sunday May 05, 2013 @06:12AM (#5657997)
"PySlice" with karma 25 is probably your trolling account. If not, ASK about stuff you have no clue about. It is better than looking like a little troll kid, having "fun" lowering the quality of HN by stupid language war comments.

>>where all arguments come in a flattened array

That is optional, through the power of CPAN (and kbenson's methods, of course). Examples of alternatives:

http://search.cpan.org/~barefoot/Method-Signatures-20130222/...

http://search.cpan.org/~flora/MooseX-Declare-0.35/lib/MooseX...

http://search.cpan.org/~ether/MooseX-Method-Signatures-0.44/...

(Depending on if you use Moose or not.)

One of the cool parts of Perl is that the language is extensible, that is why it e.g. has a better OO than Python, Ruby, etc. (Or simple typing of parameter arguments, see the modules above. Or why MooseX::Declare has ... ah, look yourself, troll.)

Re:How Perl Saved the Human Genome Project (1996) by nijk on Sunday May 05, 2013 @05:10PM (#5659750)
"the" language is then more of a loosely couples family of languages.
Re:How Perl Saved the Human Genome Project (1996) by berntb on Tuesday May 07, 2013 @10:24AM (#5668273)
Not half as much as any Lisp variant with good macros.

Edit: The possibility to extend your environment is generally seen as a good thing, unless you believe in cleanliness of bloo... languages for ideological reasons.

Re:How Perl Saved the Human Genome Project (1996) by nijk on Sunday May 05, 2013 @05:09PM (#5659746)
That is a lie. Some of the arguments are provided as global variables like $_, (no need to remember its name, since its value will be implicitly used whenever you omit a necessary argument) whose value is decided by something akin to Clippy choosing what seems most handy.
Re:How Perl Saved the Human Genome Project (1996) by kbenson on Sunday May 05, 2013 @06:56PM (#5660112)
$_ is not global, it's lexical. It's value is not haphazardly chosen, it is the topic for structures that topicalize.

You seem to be proving what I said earlier[1]. You think you understand what's going on, but in truth you don't. Feel free to continue making assertions regarding things you don't know, I can't stop you, but be aware that to do so is dishonest.

[1]: https://news.ycombinator.com/item?id=5657901

Re:How Perl Saved the Human Genome Project (1996) by Mithaldu on Sunday May 05, 2013 @05:22PM (#5659803)
$_ is very clearly and sharply defined. Only because you never took even a slightly look at the documentation does not mean you should just make up things. :)