Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Strict isn't strict enough (stop it)

by tye (Sage)
on Dec 31, 2011 at 18:02 UTC ( #945758=note: print w/replies, xml ) Need Help??

in reply to Re^2: Strict isn't strict enough (stop it)
in thread Strict isn't strict enough

"Don't poke yourself in the eye."
"Doctor, it hurts when I slice through my eye with a chainsaw."

Although the docs you linked to are a bit over-the-top (quite an unfortunate thing in such a core module), they make a good point:

To provide the capability to set/get class-wide settings, it is best instead to provide accessors as subroutines or class methods instead.

The docs said, "Don't do X, do Y instead" and you used them to justify, "Since I can't do X, I'll do W" where "W" is a much worse idea than "X".

What you are doing is equivalent to having public attributes in a class. That makes for pretty bad class design (of course, some people have a hard time even conceiving of class design without the equivalent of public attributes; for example, take a critical look at Moose ;).

I'll let you struggle with whether you should abandon exposing global variables for your interface and replace them with global subroutines instead. There can certainly be advantages to that. But I won't try to scare you into such a decision with over-the-top proclamations. "Trust me". (:

- tye        

  • Comment on Re^3: Strict isn't strict enough (stop it)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://945758]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2018-05-23 03:43 GMT
Find Nodes?
    Voting Booth?