• TS (unregistered)

    That's Roger's Profanisaurus. A bit different from Roget's work.

  • xorium (unregistered)

    So... Joey was well acquainted with Kevin Bloody Wilson's work?

  • (nodebb)

    The second to last paragraph has "amateur" misspelled as "amatuer".

  • Hanzito (unregistered)

    Is it April already? If not, someone has to fill in the blanks for me. How do you get from "transfering his music collection ... onto his computer" to Perl scripts with meaningless variable names?

  • Hanzito (unregistered)

    BTW, Roger's Profanisaurus (a dirty dino?) is of course available online, and has nothing on "dirk". It does mention Charlie, Donald, and Eric, but dirk/Dirk is sadly missing.

  • xorium (unregistered) in reply to Hanzito

    Ernest encountered problems with digitizing his music collection. So he had to bring in help. And this help (Joey) got to see his desktop with the collection of nicely named scripts.

  • (nodebb)

    Re: dirk and profanity.

    I always thought of it as being just a specific sort of dagger, but ... no. It's also a verb, meaning to stab someone with a dirk-form dagger.

    And a slightly obscure and geographically specific term for the "male member"... https://en.wiktionary.org/wiki/dirk#Etymology_3

  • The Incredible Holk (unregistered)

    Not the worst variable naming we've seen on this site.

    Bonus challenge: write a series of regexes that constitutes a piece of obscene ASCII art.

  • (author) in reply to The Incredible Holk

    Trick question: all regexs are obscene ASCII art.

  • (nodebb)

    It would be truly dirty if they threw in Hungarian notation.

  • Jonathan (unregistered)

    I will confess that when I'm having an awful time getting some script to work I have named a temporary variable "$f*ck" out of frustration. But once I get things working I clean it up because why subject myself to that when I read the code later?

    (I don't put an asterisk in variable names. I just thought the spam filter might get triggered by fully-spelled out profanity.)

  • (nodebb) in reply to Jonathan

    I just thought the spam filter might get triggered by fully-spelled out profanity.

    As far as I fucking know, it doesn't.

    (Let's see...)

  • (nodebb)

    Can't claim that today's story does not live up to the web site's title.

    (No it isn't "worse than failure", that was just a backronym)

  • (nodebb)

    Profanisaurous

    Imagine if that was a real dinosaur name. It taunts its preys by throwing dirty words at them...?

    As we say in French:

    Les archéologistes ont des fouilles curieuses.

    (I'll see myself out now)

  • (nodebb)

    I feel like there might be some England English vs. US English going on here with how some words are profanity. While I speak US English, I know some of these are from England.

  • Klimax (unregistered) in reply to Hanzito

    Dirk seems to be just alt spelling for di c k.

  • (nodebb)

    TRWTF is Perl

  • (nodebb)

    I always thought of Perl as an arcane language here here

    Only if you evaluate it by someone writing code like it's the late 90s. Perl has progressed so tremendously since then, that it is truly unfair to gauge it like that. It's like comparing a modern GPU to an original Voodoo card; a lot has advanced since then.

    For example, the modern equivalent of

    my @wankoid;
    my $wankoff;
    open(SHIT,"discindex.htm");
    @wankoid=<SHIT>;
    $wankoff=join("",@wankoid);
    my @toss=split(/\nLabel\:/,$wankoff);
    

    could be something like:

    use Path::Tiny;
    ...
    my @toss = split / \n Label \: /x, path( 'discindex.htm' )->spew;
    

    You just can't judge from a book and style clear from over 20 years ago. Perl today is a thriving language, with the CPAN repository being a, frankly, unmatched wealth of community works available for anyone to use.

  • Fizzlecist (unregistered) in reply to Klimax

    A dirk is a long bladed Scottish dagger, and like most types of swords & dagger, is also slang for a penis

  • Nutcase (unregistered)

    Point me to the github repo, this looks fun.

  • xtal256 (unregistered) in reply to gordonfish

    And you think that's better? It's just as hard to read, but now all one one line!

  • xtal256 (unregistered) in reply to xtal256

    Also, "spew" sounds more like it belongs in that list of profane variable names not an actual serious function name :O

  • TV John (unregistered)

    Dirk could be connected with Dirk Diggler, initially the subject of a mockumentary but later became a character in Boogie Nights.

  • (nodebb) in reply to jeremypnet

    "Worse than failure" may have been a backronym, but it's also the only official expansion ever given for "WTF" in this context and it's never been rescinded.

  • Duke of New York (unregistered)

    This is how all Perl code should be written.

  • Duke of New York (unregistered)

    It wouldn't be a Perl article without gordonfish in the comments running his usual gimmick, "I can write this ugly Perl code in a different way (that is also ugly)."

  • (nodebb) in reply to TV John

    Or perhaps a fan of Dragon's Lair

  • (nodebb) in reply to xtal256

    And you think that's better? It's just as hard to read, but now all one one line!

    The main point that I was showing was that all that old school boilerplate, just to open and read the contents of a file, is quite unnecessary in modern Perl. There are many options for accomplishing this available in a nice clean fashion and without getting bogged down.

    It could just as well be split to multiple lines/phases for more readability:

    my $file = path( 'discindex.htm' );
    my $contents = $file->spew;
    my @toss = split / \n Label \: /x, $contents;   # Split the contents using a delimiter of "Label:" that follows a line break.
    

    Though given that this is an .htm file, suggesting that it contains HTML, in more real world practice, I would use a proper HTML/XML parsing tool, like Mojo::DOM (though the way the original author was splitting it suggests it contains something else, or in some unusual/obscure/custom encoding perhaps) as using regex to parse such markup is normally heavily discouraged.

    Also, "spew" sounds more like it belongs in that list of profane variable names not an actual serious function name :O

    Lets be honest, this type of criticism could be made of any language or function that one doesn't recognize and can't be bothered to look at the documentation for.

  • (nodebb) in reply to Duke of New York

    I don't speak up often at all about that, so there is no "usual gimmick", nor have I been the only one. Perl absolutely doesn't not need to be written as tight and short as possible. It can and often is written in an elegant, readable manner. Like with any language, once you know it better, you can find more efficient ways to write things, which can indeed sometimes come at the expense of readability to the less experienced, since there are things that have yet to be learned.

  • Duke of New York (unregistered) in reply to gordonfish

    I’ve watched you do it on literally every Perl article. Sometimes I wonder if it’s a “bit,” especially when you bring up indented /x substitutions.

    The other WTF is, why does the loop stop at $#penis-1? $#arr in Perl has the -1 built in. It could be intentional but I’m not bettin’.

  • (nodebb) in reply to Duke of New York

    I’ve watched you do it on literally every Perl article

    I have commented on maybe a handful of articles in the past, but I am at a complete loss as to how to arrived at "every" when that simply isn't true by any stretch; I haven't even been commenting on this site for very long.

    And why, should I ask, wanting to correct people operating on woefully out of date ideas be considered a negative, instead of a net positive when it's pointed out that what you thought you knew was not accurate? I don't judge other languages that I'm less familiar with (and I have and do use a lot) and I have in the past even admitted that Perl code can get rather wild in the right hands (especially golfers), though this site alone has shown how atrocious code can be written in any language.

  • (nodebb) in reply to Duke of New York

    The other WTF is, why does the loop stop at $#penis-1? $#arr in Perl has the -1 built in. It could be intentional but I’m not bettin’.

    I agree that looks like a mistake unless they really meant to stop one element short.

  • Duke of New York (unregistered)

    Maybe it's circumcised.

  • Ray (unregistered)

    To be honest, I'm kind of surprised this story actually included KBW, if I was to ask any of the people I know who don't live here in Australia, none of them would know who he is, Americans are the worst for not knowing anything Aussie.

  • lf (unregistered)

    A cunning linguist indeed!

Leave a comment on “Linguistic Perls”

Log In or post as a guest

Replying to comment #:

« Return to Article