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

Re: Let's talk about trim() so more

Thread Previous | Thread Next
From:
Chris Prather
Date:
March 26, 2021 23:37
Subject:
Re: Let's talk about trim() so more
Message ID:
CAEFJ16_v1=gnb4F48y8btXsdgeFQDxyah1w=VfEvO=4QMUR+4Q@mail.gmail.com
On Fri, Mar 26, 2021 at 6:42 PM Philip R Brenan <philiprbrenan@gmail.com>
wrote:

>
> Perfection is achieved, not when there is nothing more to add, but when
> there is nothing left to take away.
>
> Antoine de Saint-Exupery
> <https://www.brainyquote.com/authors/antoine-de-saint-exupery-quotes>
>
I love this quote, it's one of the one's Stevan recited frequently
regarding the design of Moose.

On the one hand `trim()` is expanding the number of builtin functions and
littering the namespace with extra things to remember. A differing view is
that that is that `trim()` removes a common use of `s/^\s+|\s+$//g` and
everything that entails the user to understand about Perl's implementation
of regular expressions for the simple common case of "removing starting and
trailing whitespace".

Interpreting this maxim with the idea that syntax is what should be taken
away, you end up with the lambda calculus, tinyBF, and OISC computers where
they are beautiful in their simplicity, but maximize the amount of
information the programmer has to maintain while programming. Interpreting
this maxim the other way you end up with ... well the common punchline when
I was starting out was "Perl."

Antoine de Saint-Exupery isn't famous for writing empty books, he's famous
for an expressive use of poetic language that contained enough, but no
more. Perl is certainly not a minimalist language, but in my experience it
tries (sometimes unsuccessfully) to allow for an expressive use of poetic
language that minimizes how much state the developer has to maintain in
their head at a time.

-Chris

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