Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Practical example of "Is Perl code maintainable" (golf)

by eyepopslikeamosquito (Canon)
on Aug 13, 2007 at 21:14 UTC ( #632316=note: print w/ replies, xml ) Need Help??


in reply to Re: Practical example of "Is Perl code maintainable" (golf)
in thread Practical example of "Is Perl code maintainable"

my( $dev, $ino, $mode )= stat( _ ); return $mode; }
I disagree with introducing the $dev and $ino variables here, given that they are not being used. Many languages will throw a "variable is initialized but never used" warning if you do that sort of thing. Apart from that, I feel it makes maintenance harder because the maintenance programmer has more variables to visually digest ... and then perhaps ponder why they are not being used. For similar reasons, I dislike capturing parens in regexes when the captured values are not being used; I find myself visually checking the code for $1, $2, ..., wondering if I've missed something.


Comment on Re^2: Practical example of "Is Perl code maintainable" (golf)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-07-04 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls