develooper Front page | perl.perl5.porters | Postings from May 2021

Re: Revisiting trim

Thread Previous | Thread Next
From:
mah.kitteh via perl5-porters
Date:
May 27, 2021 16:45
Subject:
Re: Revisiting trim
Message ID:
GZQfPgrG0HkKsPeK8cYIfE2Yaeq_fXLcpMI4HhCtdnFFeGfZcBKr9YU4fg-LfbILqF6TXE9KY6oUWaoOKAuzfAWXWse7kBlj3h7pFYutFFw=@protonmail.ch
--
oodler@cpan.org
√https://github.com/oodler577
#pdl #p5p #p7-dev #native @ irc.perl.org

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, May 27, 2021 11:36 AM, Scott Baker <scott@perturb.org> wrote:

> On 5/26/21 1:20 PM, Neil Bowers wrote:
>
>> - We think we should add a single function to Perl.
>> - It should return the trimmed string.
>> - It should be called "trimmed", not "trim".
>>
>> This is not a mandate, but it is our recommendation.
>
> As the original author of this I appreciate the clear and concise response. Thank you PSC for continuing to meet and discuss these issues and provide guidance.
>
> Personally I'd prefer trim() instead of trimmed() just for consistency with other languages:
>
> - PHP = [trim()](https://www.php.net/manual/en/function.trim.php)
>
> - Javascript = [trim()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)
>
> - Raku = [trim()](https://docs.raku.org/routine/trim)
>
> - Go = [trim()](https://www.geeksforgeeks.org/how-to-trim-a-string-in-golang/)
>
> - Vimscript = [trim()](https://github.com/vim/vim/commit/295ac5ab5e840af6051bed5ec9d9acc3c73445de)
>
> - PowerShell = [trim()](https://devblogs.microsoft.com/scripting/trim-your-strings-with-powershell/)
>
> - VBA = [trim()](https://trumpexcel.com/vba-trim/)
>
> - C# = [trim()](https://www.c-sharpcorner.com/uploadfile/mahesh/trim-string-in-C-Sharp/)
>
> - String::Util = [trim()](https://metacpan.org/pod/String::Util#trim($string),-ltrim($string),-rtrim($string))
>
> - Text::Trim = [trim()](https://metacpan.org/pod/Text::Trim)
>
> - Lisp = [string_trim()](http://clhs.lisp.se/Body/f_stg_tr.htm)
>
> - Python = [strip()](https://www.journaldev.com/23625/python-trim-string-rstrip-lstrip-strip)
>
> - Ruby = [strip()](https://ruby-doc.org/core-2.7.1/String.html#method-i-strip)
>
> If we go with trimmed() we'll definitely be an outlier. Since the PSC has agreed this is a valuable feature, and should be included in core (bike shedding is done), the only thing left to debate before we have a final implementation is the name.

a. being an outlier is an indicator that you're in the lead, generally; PHP, e.g., has a whole set of functions that are interfaces to PRCE..thought I forget what the "P" in that means...

b. "be included in core (bike shedding is done)" - WAY to early to state this, and it's therefore ambigious what the first part of this statement even refers to or means

> I'd like to being work in earnest next Monday on this feature. Can we debate the best name here for a couple days so I can begin work on the final feature? I have a large rebase on the PR to do, and some other tweaking.

This is quite presumptuous. There has been no conversation on where to place this. It's very concerning to me that there has also been very little discussion about "where" to place this "single" (yeah right) core feature. At this point, and mainly due to the pressure and rush being applied to this, my general concern as I said last night is not necessarily "trim" as the POC is currently implemented; but what comes after "trim" and how it's handed - string related or not. So what's the rush? No rush exists other than the proof of concept work facing potential bit rot. That's not really perl's problem.

Brett

> - Scott
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