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

Re: Naming the trim() variants (was Re: Let's talk about trim() somore)

Thread Previous | Thread Next
Christian Walde
March 27, 2021 04:06
Re: Naming the trim() variants (was Re: Let's talk about trim() somore)
Message ID:
On Sat, 27 Mar 2021 04:58:11 +0100, Darren Duncan <> wrote:

> On 2021-03-26 4:00 p.m., Christian Walde wrote:
>> Frankly, we just need someone from PSC to tell Scott to go ahead with the
>> latter, and put out a call figuring out the best combination of names. And i
>> find it ... less than optimal to string him along further like this.
> I have a proposal on the naming which fits my general sensibilities.
> Use trim() for the version which modifies its argument, and trimmed() for the
> version that doesn't and returns the result.
> The idea here is that the modify-argument is named with a verb, "trim" (short
> for "trim this"), because it "takes some action".
> And the non-modifying version is named with a noun or an adjective, "trimmed"
> (short for "trimmed version of this"), because it finds a value corresponding to
> the input sans bounding whitespace, and does not "do" anything.

Yep, this was recommended in the github issue and is one nice solution.

For those who haven't yet, this is a must read here: :)

(I have no particular opinion on triml and trimr, might be nice.)

With regards,
Christian Walde

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About