Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: •Re: Perl Programming guidlines/rules

by hakkr (Chaplain)
on Nov 21, 2002 at 17:21 UTC ( [id://214825]=note: print w/replies, xml ) Need Help??


in reply to •Re: Perl Programming guidlines/rules
in thread Perl Programming guidelines/rules

:) I thought the $_ thing would be a bit controversial.

Sometimes it makes code harder to read so I say never use it unless it's a perlish function like map where it is obvious what it refers to.

  • Comment on Re: •Re: Perl Programming guidlines/rules

Replies are listed 'Best First'.
Re: Perl Programming guidlines/rules
by Abigail-II (Bishop) on Nov 21, 2002 at 17:27 UTC
    That's stupid. Sometimes regexes make code harder to read. Same comments, OO, subroutines or arrays make code harder to read. But only PHBs use such arguments to outlaw them via a coding standard.

    Abigail

      yes but you can improve those things there is not much you can do to improve the readability of $_.

      For non perl programmers it can be new concept so also increases learning curve of maintaining the code

        Well, I would make coding standards for good programmers, and from a good programmer, I would assume he/she knows the language. Non-perl programmers shouldn't program Perl. And as a manager, or tech-lead, I wouldn't allow non-Perl programmers to touch Perl code.

        Perhaps rule 0 should be: "People who can't program in Perl are not allowed to touch the code".

        $_ is one of the most basic things in Perl. If you have problems with the readability of $_, you shouldn't call yourself a Perl programmer.

        Abigail

Re: Re: •Re: Perl Programming guidlines/rules
by perrin (Chancellor) on Nov 21, 2002 at 17:26 UTC
    I agree. I only use $_ in places like map where it is required.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-25 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found