in reply to Re^3: sort AoH buggy? (deprecation candidate)
in thread sort AoH buggy?

It's causing more damage than benefit and fixing old code is easy. Plus a pragma could switch it back on.

> I assume you're referring to the sort my_comp LIST syntax

Obviously like discussed.

See also the perldoc choroba quoted, one case is just distinguished by a whitespace.

I just trained a new Perl programmer and gave him a set of orthogonal rules how to read and (de)construct the syntax, instead of relying on try-and-error ...

Which was hard enough, the perldocs already read like spaghetti code.

Now I have no idea how to justify that useless folly.

The more logical Perl is constructed, the easier it is to promote.

I'm still waiting for someone giving me a usecase were this syntax gives any benefit justifying the costs.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^5: sort AoH buggy? (deprecation candidate)
by hippo (Archbishop) on Dec 10, 2021 at 15:43 UTC
    It's causing more damage than benefit

    IYHO, of course. Personally speaking I see it as neither a huge boon nor a terrible disaster.

    and fixing old code is easy

    It really isn't. Technical debt is a huge problem within the industry - just ask any COBOL programmer (if they will let you onto their superyacht). I have seen comments like

    # This next line is essential for this subroutine to work but I don't +know why. # DO NOT TOUCH OR REMOVE IT!

    too many times to be shocked or surprised. Any time you touch old code you risk breakage and the older the code the higher the risk.

    The more logical Perl is constructed, the easier it is to promote.

    Completely agree (so long as it doesn't end up just being a dialect of python ;-p)


    🦛

      NB: I said deprecation candidate

      I doubt it's complicated to transform

      • sort my_comp LIST
      to
      • sort {my_comp} LIST
      but YMMV.

      In the end this would boil down to using pragmas to keep old code afloat. And consequently to a similar discussion like use v7; was.

      Problem is that the community has no agreement about the goals and their target groups.

      I'd say they can't even communicate about that, at least in a productive way.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        I doubt it's complicated to transform ...

        Not at all in one line of a 20-line script. But to do it reliably across many files in a 1,000,000 line codebase without breaking anything? That's a different matter entirely. Never mind the shops who are running 15-year-old Perl systems with no Perl maintainer on the books.

        a similar discussion like use v7; was.

        Quite so. I applaud the enthusiasm of those who proposed it but to do so in a language which has always striven for backwards compatibility was inevitably going to be a big task. For every agile developer crying, "Throw it all out!" there is a sysadm or project manager with a legacy burden screaming "Keep it all in!".


        🦛

Re^5: sort AoH buggy? (deprecation candidate)
by jdporter (Paladin) on Dec 10, 2021 at 13:33 UTC
    Obviously like discussed.

    It was not obvious. In fact it was quite unclear. Because you wrote the following, and I quote:

    sort { my_comp } LIST
    I'd say this syntax should be deprecated.

    That's why I asked.

    I reckon we are the only monastery ever to have a dungeon staffed with 16,000 zombies.
      as you said, it wouldn't make sense.

      > Otherwise, you're just ... wrong.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery