← Back to context

Comment by rurban

2 months ago

It's more readable than C++, C or Rust though

100% depends on how it’s written. It gives a ton of flexibility regarding incorporating “magic variables” which can lead to incredibly abstruse code. The language motto is “there’s more than one way to do it”, and that’s implemented to a fault.

  • Paraphrased quote from one of my professors years ago:

    Writing readable perl is easy, just code it like it's LISP.

    Granted, he was working with it in AI/bioinformatics.

    One of my classmates who moved into the IT/management side of things historically got much quicker responses from the dev team whenever he volunteered to code something, as he was always going to do it in perl.

  • Same with C or C++. Only recently there came up some examples of well-written C++ code. But most of old cooperate, Microsoft or Stroustrup code is just horrible, worse than hard-core perl nonsense.

    • Real Programmers can write FORTRAN in any language.

      Making a large code base easy to read is very hard. People often work on tiny code bases and talk about how easy it is to read, not understanding that they are comparing something with a couple thousand lines of code to something with tens of millions.

    • > Only recently there came up some examples of well-written C++ code.

      I'm not sure what you're referring to (link?) but note that whether C++ code is good or bad can depend strongly on the tooling. Certain coding patterns can be fantastic when your tooling can adequately detect their misuse, and awful when it doesn't. Which means sometimes you can't tell just look at code and tell whether it is good or bad.

      > But most of old cooperate, Microsoft or Stroustrup code is just horrible, worse than hard-core perl nonsense.

      I got the impression Microsoft's C code was always pretty good, their C++ not so much a decade ago - not sure how their C++ is now.

Depends on who wrote it. My own Perl code, and plenty I've seen, is extremely clean and readable; sadly, a lot isn't. I'm sure clean and readable C++ exists, but the stuff I have to work with - big codebases with tons of history - is not. "Terrifying" would be more apt in most cases.

  • The Perl code I write today is much cleaner and easier to follow than what I wrote 30 years ago. I hope that's true of my programs in other languages too.