in reply to Is this OK?

Go for it! :)

I'm still licking my wounds from a few months back when I tried unsuccessfully to coax the full script and backstory behind one of the most horrifying "Perl" snippets I have ever seen. I was genuinely curious about the backstory behind this horror and felt the complete script and backstory were required to make it interesting enough to post to the Daily WTF. My evil plan failed when the perpetrator was too lazy to respond. :( :( :(

It might be fun to unearth WTF code inspired by famous Larry Wall quotes, such as "Doing linear scans over an associative array is like trying to club someone to death with a loaded Uzi".

See also:

Replies are listed 'Best First'.
Re^2: Is this OK?
by cavac (Prior) on Apr 12, 2022 at 14:52 UTC

    My evil plan failed when the perpetrator was too lazy to respond.

    While i'm not the original perpetrator, i might have something. If you really need some horrifying code to be happy, i happy to look into my own source code archives this evening and have a go at trying to dig something up from one of my very early perl projects(*). Can't promise anything, haven't touched those repos in nearly 18 years, but they should still be readable.

    (*) In a movie, this would be the time to [Cut to black&white flashback with a swirly transition]
    perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

      > If you really need some horrifying code to be happy...

      Ha ha, it only makes me happy when I understand the root cause of how it happened in the first place. When I see truly horrifying code in production at work, I'm not interested in ridiculing the individual responsible, I feel profoundly curious as to how on Earth such code made it into production in the first place ... and feel an irresistible urge to uncover the root cause to make sure it doesn't happen again.

      One common cause of ridiculously bad code making it into production I've seen is when the non-technical manager (who never looks at the code) rates an individual's performance based on KPIs, such as productivity. Team-based KPIs produce higher quality and more maintainable code in my experience. These topics are touched upon in: