develooper Front page | perl.perl5.porters | Postings from July 2020

Re: try/catch and CLEANUP/FINALLY/&c.

Thread Previous | Thread Next
From:
Felipe Gasper
Date:
July 18, 2020 14:16
Subject:
Re: try/catch and CLEANUP/FINALLY/&c.
Message ID:
AE4DDF64-FD2F-46DB-ABBA-54EA5D86BA9E@felipegasper.com


> On Jul 18, 2020, at 07:41, Eirik Berg Hanssen <Eirik-Berg.Hanssen@allverden.no> wrote:
> 
> 
>> On Sat, Jul 18, 2020 at 1:24 PM Felipe Gasper <felipe@felipegasper.com> wrote:
> 
>> > On Jul 18, 2020, at 3:00 AM, Branislav Zahradník <happy.barney@gmail.com> wrote:
>> > Plain cleanup is also a little bit less confusing than try/finally construct (there is try, where is catch?)
>> 
>> I disagree; the more widespread “finally” pattern is IMO much less confusing. Reasons:
> 
>   Without a catch, this follows the same pattern as Perl's END blocks, no?
> 
>   Seems less confusing to this Perl programmer, at least.

That’s fair. But then, what gain is realized from CLEANUP versus the likes of Scope::Guard? A bit less typing, I guess?

-F
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About