in reply to Re: Is "ref($class) || $class" a bad thing?
in thread Is "ref($class) || $class" a bad thing?
merlyn has railed against this construct for years. Do a Super Search for "cargo-cult programming" and you'll find hundreds of nodes on the topic.I doubt that it is actually "hundreds". {grin}
Basically, that construct is saying "This method can be called as either a class or instance method".But that isn't why I'm rallying against it. In my own perlboot docs, I show many examples of methods that can be called on either class names or instance values. Please see my recent column on constructing objects, especially the last few paragraphs, for the best description of specifically what I rally against.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|