develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Pre-RFC: “helpcodes” feature

Thread Previous | Thread Next
From:
Karl Williamson
Date:
June 8, 2022 11:45
Subject:
Re: Pre-RFC: “helpcodes” feature
Message ID:
e5e58c8c-8b13-fae2-06a9-4076ded1a87b@khwilliamson.com
On 6/8/22 00:02, Ovid wrote:
> On Tue, Jun 7, 2022 at 6:56 PM Felipe Gasper <felipe@felipegasper.com 
> <mailto:felipe@felipegasper.com>> wrote:
> 
>     Changing the wording of the error message as it stands risks
>     breaking preexisting applications. So it seems imprudent to do it
>     without a feature/pragma.
> 
> 
> This is true. It also kills me every time I see that. One of the (many) 
> beautiful things of throwing exceptions is being able to test the class 
> of the object. If people do that, changing the wording of the error 
> message isn't that big of a deal (and makes it safe to localize, provide 
> additional information about the error, etc.)
> 
> I really wish warnings were the same: objects that stringify 
> intelligently. If your application or tests trap it, they use the class 
> to figure out the type of warning it is and the actual text is for the 
> poor humans writing the code. Relying in arbitrary text is fragile code. 
> /Providing/ arbitrary text and nothing else is proving fragile code. I 
> wish we didn't do that.
> 
> So many of these "we can't change the text" discussions would simply go 
> away.
> 
> /end rant
+1

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