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

Re: Pre-RFC: “helpcodes” feature

Thread Previous | Thread Next
From:
Ovid
Date:
June 8, 2022 06:03
Subject:
Re: Pre-RFC: “helpcodes” feature
Message ID:
CA+M4CHu8Y1Kp_hHFWDTQTQCSkQPUw9dKp5vo11P+_QAH5mbOWA@mail.gmail.com
On Tue, Jun 7, 2022 at 6:56 PM Felipe Gasper <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

Curtis "Ovid" Poe
CTO, All Around the World
World-class software development and consulting
https://allaroundtheworld.fr/

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