On Jan 6, 2008, at 5:10 AM, Michael G Schwern wrote:
nadim khemir wrote:
As for the layers of neurosis, the only anxiety is the one created
by your own
delusions. I see only a test like an other.
If we had infinite time and attention, yes. But we don't. And
time spent
checking the return value of print and writing a complicated test
for if it
fails is time that could be better spent elsewhere. I discussed
this issue of
Opportunity Cost in testing last month.
http://www.nntp.perl.org/group/perl.qa/2007/12/msg9918.html
[snip]
I agree with Schwern. I wrote that Perl::Critic policy, but I
deliberately made it a low severity policy and I turned print() off
by default. The main reason I wrote that policy was because PBP
recommended checking return values of non-throwing built-ins. One of
the main arguments for checking return values is close(), which most
people don't check but which can catch important failures (pipe
errors, full disks, etc)
In truth, I rarely use print() any more except the occasional C<print
STDERR "debug msg...">. I frequently use Catalyst and/or
File::Slurp, so most of the output of my code is wrapped for me.
Chris