Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
The stupid question is the question not asked
 
PerlMonks  

Re^4: Module Announcement: Perl-Critic-1.01

by Herkum (Parson)
on Jan 26, 2007 at 18:08 UTC ( #596765=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Module Announcement: Perl-Critic-1.01
in thread Module Announcement: Perl-Critic-1.01

I can understand not wanting the code to shout. However, when you are working with special system variables. They are so compact and non-descriptive they can be problematic to identify and debug. Imagine looking at $/ and meaning to use $\, talk about subtle.

English may have code that SHOUTS but it brings attention to itself with the upper-case syntax and is more descriptive than the built-in variable names. There are good reasons why TheDamian recommended its use in PBP.


Comment on Re^4: Module Announcement: Perl-Critic-1.01
Re^5: Module Announcement: Perl-Critic-1.01
by xdg (Monsignor) on Jan 26, 2007 at 18:43 UTC
    Imagine looking at $/ and meaning to use $\, talk about subtle

    I used to have trouble remembering these until I read somewhere about thinking about them like funnels -- just mentally remove the "S" from the "$".

    |/ is a funnel *in* ($/) |\ is a funnel *out* ($\)

    That doesn't change your point about subtle -- it's just the mnemonic I picked up somewhere.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re^5: Module Announcement: Perl-Critic-1.01
by stvn (Monsignor) on Jan 26, 2007 at 21:56 UTC
    However, when you are working with special system variables. They are so compact and non-descriptive they can be problematic to identify and debug. Imagine looking at $/ and meaning to use $\, talk about subtle.

    I suppose a lot of this really depends on how oftern you need to use special punctuation vars. Most of my $work code (medium-large web app) I never use anything other than $@. And the longer version of this (IMHO of course) is just overkill.

    English may have code that SHOUTS but it brings attention to itself with the upper-case syntax and is more descriptive than the built-in variable names.

    I can understand wanting to bring attention to certain usages of these variables, but not all. With more common variables and usages (like $@) it ends up being a distraction to the visual flow of the code, and drawing attention to an "exceptional" case.

    -stvn

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-04-21 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (494 votes), past polls