http://qs1969.pair.com?node_id=11124922


in reply to Why Perl in 2020

Hi, Alex,

That is a great writeup and really enjoyed reading it. For background, I am not a professional developer and just program as a hobby. As such, I am free to choose whatever language suits my fancy. It's funny because when I first started on this journey, I swore I would never touch Perl as it was the most inscrutable and impenetrable language I encountered. But I recently decided to give it a try and have to say I have been pleasantly surprised. In addition to what initially drew me to it a few weeks ago, I've come to appreciate a few more things about the language, none of which are new to the stalwarts who ply the halls of the Monastery:

The one downside for me is the TIMTOWTDI philosophy of Perl. I know that many advocates espouse this a a good thing but I sometimes wish there was just one idiomatic way to do something. I routinely struggle with the paradox of choice in many aspects of my life and this is one area where I wish I wouldn't suffer the same fate. But otherwise, I am really enjoying Perl. I've even managed to amass 13 stars in this year's Advent of Code competition with what little spare time I have this time of year. And I have to say, I'm really enjoying it!

Gratias tibi ago
Leudwinus

Replies are listed 'Best First'.
Re^2: Why Perl in 2020
by Discipulus (Canon) on Dec 10, 2020 at 08:14 UTC
    Discipulus Leudwini saluta, (latin greeting)

    > The one downside for me is the TIMTOWTDI philosophy of Perl.

    Freedom is hard. Only the pure slave has one and only one path to follow.

    As you are somehow new to Perl this can be confusing, but you stated you liked the similarity to bash, awk, grep, sed and other tools you commonly use on the command line. People coming from C recognize other similarities, functional programmers find they can program with Perl in the way they like, as OO people do. For what I saw from wiser monks Perl permits any programming tecnique without complaining.

    This is the malleability ait is speaking about. This is what makes, in my opinion, Perl a humanistic language: the programmer is as free as possible to choose their own way to reach their goals.

    I started as you as hobby (but many years ago) and after the first shocking impact with sigils (I wrote just few html tags before: no basic, no batch, no bash) I found very comfortable with Perl exactly because it permitted me to express myself in a primitive way without complaining. Then it is up to you to change the approach, but only if you have the need. I wrote my first real module (not a mess of exported subroutines, a real module) ten years later or so. Only recently (2 years ago) I wrote a real module with a decent test suite worth to be published on CPAN.

    So, as you are writing from an abbey near Augusta Trevorum, you can now meditate about aribitrium with this sentences from my homeland: liberum arbitrium est habitus animae liber sui

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^2: Why Perl in 2020
by tangent (Parson) on Dec 10, 2020 at 22:42 UTC
    The one downside for me is the TIMTOWTDI philosophy of Perl. I know that many advocates espouse this a a good thing but I sometimes wish there was just one idiomatic way to do something.
    There is a way to force yourself, or your team, to do things in a specific way and that is to use the Perl::Critic module combined with a set of your own policies. You simply pass everything you write through Perl::Critic, during a testing phase for example, and it will list everywhere you have broken the policies. After a while, a habit develops and your code becomes very consistent first time round. Great for new team members to help familiarise them with the house style.