http://www.perlmonks.org?node_id=402639


in reply to The joys of bad code

This is my all-time favorite funny code:
my %hash = ( 1 => 1, 2 => 2, 3 => 3, 4 => 4 );
Of course *I* didn't write this ;-)
Strangely enough nobody's offered bad code they wrote...

jayrom

Replies are listed 'Best First'.
Re^2: The joys of bad code
by revdiablo (Prior) on Oct 26, 2004 at 16:47 UTC
    Strangely enough nobody's offered bad code they wrote

    Is this a challange? Oh boy, do I have some bad code that I've written. Of course, I know better nowadays. But back then... boy oh boy. Let me dig through my dead code archive for some examples.

    So yeah. Now that I've let some of this stuff out there, and everyone thinks I'm a terrible coder, are you happy? Did I live up to your challenge? :-)

    Update: added <readmore> tags.

    Update: I guess my willingness to post my own old, bad code gets me downvotes. How very pleasant.

      I can't believe you got downvoted!
      I wish I could have upvoted you more than once for your willingness to show yourself in an unflattering way.
      I, for one, has only to look at yesterday's code to already find stupid things that could be rewritten better... but I'd rather not share them ;-)

      jayrom

        I can't believe you got downvoted!

        It must have just been a random thing, because the node rep is now quite positive. I probably should not have put that snarky update. It seems silly now that I think about it.

        I, for one, has only to look at yesterday's code to already find stupid things that could be rewritten better

        Yeah, mine is probably still not perfect, but what I pasted is 3 or 4 years old. I'd like to hope I do better stuff than that nowadays. :-)

Re^2: The joys of bad code
by TheEnigma (Pilgrim) on Oct 26, 2004 at 23:39 UTC
    Strangely enough nobody's offered bad code they wrote...

    I would like to offer up one of the first programs I ever wrote, a bowling 'simulation' written in BASIC when I was in high school. Talk about spaghetti code!

    I would like to..... But I can't. It's on paper tape. (Really!)

    I suppose I could scan it...

    TheEnigma

Re^2: The joys of bad code
by Anonymous Monk on Oct 28, 2004 at 00:17 UTC
    That isn't *necessarily* bad code. It could be discrete input data that, by pure coincidence, turned out to be linear with no offset. :)