Skip Menu |

This queue is for tickets about the Try-Tiny CPAN distribution.

Report information
The Basics
Id: 66121
Status: resolved
Priority: 0/
Queue: Try-Tiny

People
Owner: Nobody in particular
Requestors: ovid [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: Clarify the "just silence errors" example
We've had a large debate at work about using Try::Tiny. We had some code like this: eval { some_code() }; For Java devs, it used to be moderately common to have empty catch blocks while developing to ignore checked exceptions, but this was laziness was bad and led to many errors. At the very least, a *desired* empty check block should have been commented. In our code, the exception was not checked and this is sadly common for eval (at least, I've noticed it being a common anti-pattern in many companies I have worked for) and I argued that competent devs would see a try {} without a catch {} and, unlike the eval, automatically wonder that something was up. Unfortunately, the first counter-argument was "but the Try::Tiny docs have an unchecked exception in the SYNOPSIS". I would suggest updating the docs to make it clear that a try without a catch is strongly discouraged and, if needed, should at least be documented carefully. Cheers, Ovid