-
Questioning Standard Idiom
2004-06-30 16:29 in /tech/perl
I think I’ve decided to jettison the popular
ref $that || $that
idiom from my Perl objects. To some extent, I’m just being silly because what’s put me over the edge is the fact that you basically can’t get complete test code coverage for this construct, so my Devel::Cover reports are doomed to stay short of 100%.However, the fact of the matter is that I never make use of this “feature” of my objects. For that matter, I don’t think I’ve ever seen anyone else use this feature either. To put the final nail in, it’s a completely false analogy to C++ copy constructors. No copy is made — it’s just another default constructor.
So, no more will I use this incantation, unless I’m actually creating a real copy constructor.
Leave a comment
Please use plain text only. No HTML tags are allowed.