Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Style: buried variables or double referencing?

by rjbs (Pilgrim)
on Aug 20, 2005 at 20:00 UTC ( #485425=note: print w/ replies, xml ) Need Help??


in reply to Style: buried variables or double referencing?

Using Readonly::XS is nice and all, but I generally just use $NAMING_STYLE to tell the difference. It's not foolproof, but it's simple. (I'm sure that now I will go write code that breaks itself by assigning to a fake constant.)

What surprises me is that lack of mentions of putting those data into configuration. I'm not sure what kind of efficiency you're working for, but things like constants are often best moved to options or configuration. You can change them all you like without having to worry about rev'ing the code.

rjbs


Comment on Re: Style: buried variables or double referencing?
Download Code
Re^2: Style: buried variables or double referencing?
by punkish (Priest) on Aug 21, 2005 at 02:00 UTC
    > lack of mentions of putting those data into configuration

    holli did, above in Re^3: Style: buried variables or double referencing?. I really resonate with that suggestion. External config files, external templates... the rule is simple -- anything and everthing external to the code should be kept externally.

    --

    when small people start casting long shadows, it is time to go to bed

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-09-23 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (222 votes), past polls