logoalt Hacker News

KaiserPro07/31/20257 repliesview on HN

I took great pride in making readable, maintainable perl.

I worked at a VFX place that was held together by loads of perl, written over a good 15 years. Some of it was clever, but most of it was plain readable scripts.

The key to keeping it readable was decent code reviews and someone ripping the piss out of you for making unreadable soup.

Its all python nowadays, I do miss CPAN, but I don't miss perls halfarsed function args.

However for the longest time, the documentation for perl was >> than python. At the time python doc were written almost exclusively for people who knew how to python. Perl docs assumed you were in a hurry and needed an answer now, and if you were still reading by the end assumed you either cared or were lost and needed more info.

With the rise of datascience, python has lost its "oh you should be able to just guess, look how _logical_ the syntax is" to "do it like this."


Replies

johnisgood08/01/2025

I also found "perlcritic" to be very useful.

> perlcritic is a Perl source code analyzer. It is the executable front-end to the Perl::Critic engine, which attempts to identify awkward, hard to read, error-prone, or unconventional constructs in your code. Most of the rules are based on Damian Conway's book Perl Best Practices. However, perlcritic is not limited to enforcing PBP, and it will even support rules that contradict Conway. All rules can easily be configured or disabled to your liking.

https://metacpan.org/dist/Perl-Critic/view/bin/perlcritic

It helped me a lot. I think every Perl developers should use it, might help to avoid headache later on. Be careful with severity level "brutal" and "cruel" and "harsh", however. I think "gentle" works in many cases. That said, I used "brutal" and I only fixed the legitimate issues. "brutal" helped me write a proper POD, for one, as "gentle" does not complain about that.

m46308/01/2025

> I took great pride in making readable, maintainable perl.

In the past when I used perl, I did the same thing.

But I came to learn one thing about perl - its good point is its bad point.

When I used it, perl was the highest level language I ever used. It was expressive, meaning I could take an idea in my head, and implement it in perl with the least friction of any language.

When I worked with other people's perl, I found they were mindful and cared about what they were doing.

But the way they thought was sometimes almost alien to me, so the expression of their thinking was a completely different type of perl, and it was lots less readable to me. And frequently the philosophy of what they wrote was backwards or inside out from what I would do.

Now I have replaced perl with python day to day and although implementation of code seems a few steps removed from my thinking, it seems that other people's code is more easily read and understood. (this is just my opinion)

show 2 replies
AtlasBarfed08/01/2025

Maybe what we need as programmers for collective professional defense is to only LLM-code in Perl.

At some point when the LLM fails, you'll need a real programmer to figure it out.

But IMO, LLMs are code generation, and code generation always fails at some point when the pile of generated code topples, no matter the language.

The amount of bad enterprise LLM code that will be cranked out in the next few years is going to be fascinating to watch.

jstanley08/01/2025

> I don't miss perls halfarsed function args.

You mean you don't like writing things like...

    sub foo {
        my ($a, $b, $c) = shift;

?
show 3 replies
cestith08/01/2025

Perl’s function arguments no longer require you to shift or to access the @_ array. There are even proper argument signatures now. There’s also continuing improvements in putting a one true way to do objects into the core language, so you don’t have to bless a hash, use Moose, or Moo, or use Object::InsideOut (or any of a dozen other non-core modules).

All that old code still works, though.

jgrahamc08/01/2025

Yes, as did I! When I did POPFile (which is 100% Perl) I was really, really careful to make it readable and maintainable.

ronniefalcon08/01/2025

let me guess, MPC?