ColdFusion Muse

Don't try this Coldfusion code at home

Mark Kruger June 2, 2005 4:22 PM Follies and Foibles Comments (16)

This should probably be subtitled "be thankful if you don't read this language" (ha). Check out this excellent link of horrendously bad code from Micha Schopman on CF-Talk. I'm sure it took far longer to debug than it did to write. <g>

http://www.mschopman.demon.nl/horror.txt

(I had originally attributed this blurb to Matt Osborn but it was actually Micha Schopman.)

  • Share:

16 Comments

  • Niklas Richardson's Gravatar
    Posted By
    Niklas Richardson | 6/2/05 3:42 PM
    What DOES this do? ;)
  • mkruger's Gravatar
    Posted By
    mkruger | 6/2/05 3:54 PM
    I was hoping some CFer would recognize it from his early years and say "hey - I remember that code!!" ... then tell us what it actually does (ha).
  • Jennifer Larkin's Gravatar
    Posted By
    Jennifer Larkin | 6/2/05 3:54 PM
    RUN AWAY!

    Seriously, thanks for sharing. I needed a good laugh!
  • Jennifer Larkin's Gravatar
    Posted By
    Jennifer Larkin | 6/2/05 3:57 PM
    Having looked at it again, the funniest thing that I saw was the <cfsilent> tag at the top. It smells of an act of desperation, and cfsilent ain't gonna help that code.
  • Paul W's Gravatar
    Posted By
    Paul W | 6/2/05 4:51 PM
    I was laughing at the cfsilent too. You can’t polish a turd!
  • Jeff Coughlin's Gravatar
    Posted By
    Jeff Coughlin | 6/2/05 4:54 PM
    I'm not sure where, but I could swear I've seen that somewhere before.

    Ouch. Looking at it just hurts. If anything, at least loop over the form structure or something.

    I'm sure there are a hundred better ways to do form validation, however looking at that code just made my day :).
  • Joe Rinehart's Gravatar
    Posted By
    Joe Rinehart | 6/2/05 5:58 PM
    Hey...at least it's lovingly indented. That should make it easy to delete w/o hurting anything else...
  • Jack's Gravatar
    Posted By
    Jack | 6/2/05 6:13 PM
    I'm sorry, but I just don't see what's wrong with this.


    :-)
  • DL's Gravatar
    Posted By
    DL | 6/3/05 1:22 AM
    And there's comments, too! 3 of them!

    Granted, it gives us absolutely no clue what the heck it's verifying in 3 parts, but anyway...
  • Sean Corfield's Gravatar
    Posted By
    Sean Corfield | 6/3/05 2:40 AM
    It's not even legal syntax (if that txt file is accurate)... there's an extra cfelse clause there...
  • Andy J's Gravatar
    Posted By
    Andy J | 6/3/05 3:11 AM
    Where you get my code from ;o)

    If you cross your eyes and stare at it for 30 seconds it turns into a 3D lump of **** (you fill the blanks)


    seriously though, my brain now aches from seeing that - cheers for the laugh
  • Andy J's Gravatar
    Posted By
    Andy J | 6/3/05 3:12 AM
    Where you get my code from ;o)

    If you cross your eyes and stare at it for 30 seconds it turns into a 3D lump of **** (you fill the blanks)


    seriously though, my brain now aches from seeing that - cheers for the laugh
  • Joe Rinehart's Gravatar
    Posted By
    Joe Rinehart | 6/3/05 5:16 AM
    Where's the extra cfelse? I see a double-stacked one (not properly indented) where one of the cfelse's isn't capitalized like the rest (maybe what micha fixed?), but it matches a capticalized, double-stacked cfif that's a little left of lining up propery.
  • douglas knudsen's Gravatar
    Posted By
    douglas knudsen | 6/3/05 8:42 AM
    ha! yeah, I just blogged about a waste of code piece http://www.cubicleman.com/?id=51 amazing how folks come up with this stuff, eh?
  • dan's Gravatar
    Posted By
    dan | 6/3/05 8:59 AM
    who is the mastermind behind this work, we would like to hire him immideately!

    :) ~~
  • Pop Rocks's Gravatar
    Posted By
    Pop Rocks | 11/21/07 1:44 PM
    Oy - I just started with Coldfusion. It feels like I'll never get to the point where I can do advanced stuff with it....