Stories
Slash Boxes
Comments

SoylentNews is people

posted by LaminatorX on Tuesday December 09 2014, @02:18PM   Printer-friendly
from the call-to-erms dept.

If you are reading this and you are experienced with Perl, then your community needs you.

You see the heroic work being done by our devs Proposed Moderation Rework Experiment and think that couldn't be you? Think again Comrade - you too could be a SN hero!

Seriously - we need some Perl skilled people to offer some time. It doesn't need to be a massive commitment, a few hours here and there to squash a bug or two as it suits would be just fine.

You can contact me by email (above), or you'll find the usual reprobates malingering around #soylent on our irc server.

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by Marand on Wednesday December 10 2014, @01:25AM

    by Marand (1081) on Wednesday December 10 2014, @01:25AM (#124451) Journal

    That's not good perl

    1) I can read it
    2) I can see what it's doing
    3) The symbol:text ratio is far too low

    I made a command line parser in the '90s that fixed all those "problems" plus added regex, anonymous subroutines, anonymous arrays, and even called subs by dereferencing the aforementioned anonymous arrays. By your definition it was probably some of the best Perl ever. It'd be a waste of space to paste the whole thing, but one bit at the end stands out as "true Perl code":

    foreach (@sub) {
        &{$$_[0]}(@{$$_[1]});
    }

    In my defense, it was the end result of sleep-deprived "inspiration" and I normally avoid writing line-noise Perl. As bad as it is, it's an example of why I still like Perl more than Python: it doesn't try to force someone else's style and idea of "correct" on you. The flexibility is great, though it also means that if you want to shoot yourself in the foot, it has everything from shotguns to nukes and it won't try to stop your attempt at foot genocide. It's up to you to make the code readable, and if you want you can make something clever first and then refactor it to be readable later because Perl doesn't care.

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 3, Funny) by Marand on Wednesday December 10 2014, @01:28AM

    by Marand (1081) on Wednesday December 10 2014, @01:28AM (#124452) Journal

    ...and by posting that one line I probably guaranteed the SN staff will want to keep me as far away from slashcode as possible. Oops.

    • (Score: 2) by The Mighty Buzzard on Wednesday December 10 2014, @01:54AM

      by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Wednesday December 10 2014, @01:54AM (#124465) Homepage Journal

      Not remotely. Slashcode has a habit of sticking sub references in hash/object references to be called later like $ops->{$op}{function}->(some args here) that would have you right at home.

      --
      My rights don't end where your fear begins.
      • (Score: 2) by Marand on Wednesday December 10 2014, @02:15AM

        by Marand (1081) on Wednesday December 10 2014, @02:15AM (#124476) Journal

        Really? Ouch, what were they thinking? That's not the sort of thing you usually want to do on code you know will need tweaking and maintaining later.

        Hell, even when I did the above insane snippet I knew it was a bad idea, but I didn't care because it was a reusable code snippet that was unlikely to need maintenance later. The idea was that I could set up a list of command line switches (long and short form) by populating a hash (using the switch as a key) with sub names and the # of args expected, so I didn't care if it looked like line noise, because the only part I interacted with past creation was a pair of hashes.

        The only reason I still have it as-written is it's been completely hands-off for ~15 years. I originally planned to turn it into a module and clean it up to be less insane, but CPAN had enough parsers of the type, so I didn't see a point. I just throw it into code if I need a quick-n-dirty switch parser and occasionally trot out the line noise as an example of how not to write readable Perl. :)

        For what it's worth, I'm willing to poke around and help with the codebase if I can, but I don't know how useful I'd be since my Perl's a bit rusty. It's still my go-to choice for quick hacks but I haven't done anything of reasonable size in a while.

        • (Score: 2) by The Mighty Buzzard on Wednesday December 10 2014, @12:24PM

          by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Wednesday December 10 2014, @12:24PM (#124620) Homepage Journal

          It actually works pretty well and it's not difficult to modify... it's just a bit weird to wrap your brain around at first glance. Have a look here [github.com] if you want to see what I mean. It defines the locations of the subs and various other things about them then calls whatever came in as &op=foo (or default) via something like this [github.com] later after doing various checks. Easiest thing in the world to grok the first time you see it? Not so much. Does make things quite easy to maintain after it clicks in your head though.

          If you haven't already, feel free to get in touch with juggs@soylentnews.org and he can get you set on the path to the dark side.

          --
          My rights don't end where your fear begins.
          • (Score: 2) by Marand on Thursday December 11 2014, @01:21AM

            by Marand (1081) on Thursday December 11 2014, @01:21AM (#124926) Journal

            I see...It's almost identical to what I was doing, except easier to read because they used the arrow operator shorthand and a second hash instead of an array. Same idea, though; it's basically a struct with a reference to the sub to call, sort of like a ghetto object.

            Probably not the best way to do it, but definitely more readable than I expected, and I can certainly understand the temptation to do it that way. Perl can do a lot of really weird things that would be hard (maybe impossible?) in other languages and I used to spend a lot of time experimenting with them, so I know that temptation well. Especially metaprogramming type stuff. Perl code that modifies its own source and execs itself so that it basically evolves; scripts that keep most of their code in separate source files and eval() them in so that you can change code without re-executing; objects that load and unload parts of themselves on the fly; etc.

            Stuff that is so easy to do in Perl that you want to use it even when you know you probably shouldn't. :)

            If you haven't already, feel free to get in touch with juggs@soylentnews.org and he can get you set on the path to the dark side.

            I haven't yet, but I think I will. It wasn't clear what sort of work was needed so i wasn't sure I'd be useful, but hey, anything helps I guess.