this post was submitted on 30 Sep 2023
59 points (84.7% liked)

Programming

17450 readers
156 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] TheGiantKorean@lemmy.world 42 points 1 year ago (3 children)

If by "hard to understand" you're including trying to understand someone else's code, Perl can be a nightmare.

[–] DirigibleProtein@aussie.zone 22 points 1 year ago (2 children)

I’ve heard a few people refer to perl as a “write-only” language.

[–] dgriffith@aussie.zone 45 points 1 year ago* (last edited 1 year ago)
// Dear programmer
//
// When I wrote this code, both 
// God and I knew how it worked. 
// Now only God knows!!
//
// Therefore if you are trying to 
// optimise this routine and it fails 
// (most surely) please increase 
// this counter as a warning for the 
// next person
//
// total_hours_wasted_here = 254
[–] ajjlyman@lemmy.sdf.org 8 points 1 year ago (3 children)

There's some truth to it, but it's mostly that junior developers and senior developers with no discipline that give it a bad name.

The major problem is that it has one of the the highest capacities for writting incredibly dense code there is, paired with very powerful language transformation tooling (i.e. switch statements were added as a module, but can also be used for funny evil.)

[–] TheGiantKorean@lemmy.world 5 points 1 year ago

When I was a Perl programmer, I had to modify this other guy's code, and all I could think was that this guy was writing code with job security in mind.

[–] miversen33@lemmy.world 3 points 1 year ago (1 children)

Imo the amount of magic variables in perl is too damn high.

Like I don't want to have to keep all that in my head while parsing through thousands of lines of code. I spent a few years working as a perl developer and even near my last days there I still found myself digging through docs to figure out what certain symbols meant and did.

My first developer role was as a junior developer and I was tossed into single letter variable loop hell in perl lol.

I was telling my mentor that if I were introduced to perl now that I've got several years of experience in a variety of different languages and thought models, it probably wouldn't bother me as much. I kind of like bash (sometimes) and perl is really a hyper extended scripting language so going from bash to perl isn't too bad. But given that that is what I was started in, I have a massive distaste for it and I doubt that will ever change.

[–] richieadler@lemmy.myserv.one 2 points 1 year ago

Imo the amount of magic variables in perl is too damn high.

"Explicit is better than implicit" and "There should be one-- and preferably only one --obvious way to do it" in The Zen of Python exist, I'm sure, as a direct reaction to Perl's magic variables and TIMTOWTDI.

[–] TheGiantKorean@lemmy.world 2 points 1 year ago

OK just checked out that Hodor module. That is hilarious.

[–] frezik@midwest.social 4 points 1 year ago

Perl isn't particularly worse than JavaScript. Which itself has a lot of quirks, of course. The big thing with Perl is getting your head around list and scalar context. There's a learning curve to it, but can be very powerful once you understand. I wish more languages would do list flattening by default.

[–] richieadler@lemmy.myserv.one 3 points 1 year ago

Or your own after six months.