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

Re: Pre-RFC: Improve “wide character” warnings

Thread Previous | Thread Next
From:
Scott Baker
Date:
January 25, 2022 23:54
Subject:
Re: Pre-RFC: Improve “wide character” warnings
Message ID:
6f442fe0-2575-6cbe-97ab-bc13c8457cbb@perturb.org
I love both of these suggestions. Let me put on my Perl novice hat and 
respond directly:

 1.

    One of my favorite things about |git| is that when something is
    wrong with your working state, or you issue an incorrect command,
    |git| tells you not only that there is an error, but also what the
    most likely fix is. This has saved me numerous times from having to
    stop what I’m doing and Google the specific error. Simple one line
    errors suggestions like that can save a lot of time and frustrations.

 2.

    It would be great if the strings were Globally unique so theywere
    easily searchable in Google. I know we’re all old Perlprogrammers
    and are really comfortable with |perldoc| but the novice Perl
    programmer is going to hit Google first. If the codes were something
    like |Perl-Q1793| or |Perl_W18| then a Google search will always
    turn up the right documentation.

I imagine there will be a lot of work to implement this, as we'd have to 
go back through all the common warnings/errors. We could do them slowly 
over time, we're not forced to do them all en masse in one release.

​
On 1/25/2022 1:04 PM, Felipe Gasper wrote:
> PART 1:
>
> -----
>> perl -e'print "\x{100}"'
> Wide character in print at -e line 1.
> Ā
> -----
>
> ^^ Would it benefit if that warning instead were something like:
>
> -----
> Wide character in print (you forgot to encode) at -e line 1.
> -----
>
> The status quo merely describes the problem; I’d like to add a bit that points to the fix.
>
> --------------------------------------------
>
> PART 2:
>
> While I’m raising the issue, what would it take for Perl-issued warnings (and exceptions?) writ-large to include some sort of searchable, indexed lookup code, something like:
>
> -----
> W.18: Wide character in print (you forgot to encode) at -e line 1.
> -----
>
> Then users could search on that code in Perl’s documentation, maybe like:
>
> -----
> perldoc W.18
> -----
>
> Thoughts?
>
> -FG
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