On 10-06-28 10:15 AM, Shlomi Fish wrote:
You seem to have an obsession with getting people to stop using "my $param = shift;" and use "my $param = shift(@_);" instead. This is depsite the fact that a lot of high-quality, production code on CPAN and elsewhere is using it extensively. We already had at least two full length discussions here about it and you're still going.
I'm obsess with writing code that can be easily understood. I have had experienced a Perl programmer come up to me and say, "What does this shift do? Nothing been assigned to @_ yet. It's not doing anything." Even experienced programmers can forget the simplest of things.
As for CPAN, there's a lot of code in it that uses the two-argument open statement which is no longer consider best practice. Do use CPAN as your only guide.
Shift is just one example. Another would be that I prefer to see nested foreach loops rather than a bunch of greps.
80% of the cost of software is maintenance. That means be explicit and keep is simple. You'd be surprised at what you forget when you're under a lot of pressure to get it done NOW.
-- Just my 0.00000002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. The secret to great software: Fail early & often. Eliminate software piracy: use only FLOSS. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/