The Fabulous Flying Forray!



  • I came across this honset-to-goodness real live code today in my daily search for new WTFs in important gov't systems. Yes, they use ColdFusion and MS Access 90% of the time. Yes, in 2006. Yes, the indentation was preserved immaculately.

    The whole coding style is a WTF in itself, but anyway, without further ado, gaze upon the wonderful data storage method demonstrated here. There's no need for silly "arrays" or "objects" or "databases" here.

    <CFLOOP Index="Index" FROM="1" TO="15" STEP="1">
    <CFIF Index EQ "1" >
       <CFSET Item="Building Insulation Products">
       <CFSET mAdditionalpre="">
        <CFSET mAdditional=" (rock wool, fiberglass, perlite composite board) ">
       <CFSET mNew="">
       <CFSET mTenThousandNote="">
       <CFELSEIF Index EQ "2" >
       <CFSET Item="Carpet">
       <CFSET mAdditionalpre=" polyester ">
       <CFSET mAdditional=" for moderate wear applications ">
          <CFSET mNew="">
        <CFSET mTenThousandNote="">
    
    [... 70 lines later ...]
    

    <CFELSEIF Index EQ "15" >
    <CFSET Item="Roofing Materials">
    <CFSET mAdditionalpre="">
    <CFSET mAdditional="">
    <CFSET mNew="">
    <CFSET mTenThousandNote="">
    </cfif>

    <CFIF Index NEQ "4" > <HR>

    <CFIF Index EQ "5" >
    <H3><CFOUTPUT>#mAdditionalpre#</cfoutput><CFOUTPUT>#item#</cfoutput></H3>
    <CFELSE>
    <H3><CFOUTPUT>#item#</cfoutput></H3>
    </cfif>

    And it goes on and on and on, to a total of 270 lines. I'm not in a position to think right now, so I'll just have to say: there must be a better way to do this... but does this rank as more or less WTF than the For-Case paradigm?



  • [quote user="djork"]

    I'm not in a position to think right now, so I'll just have to say: there must be a better way to do this... but does this rank as more or less WTF than the For-Case paradigm?

    [/quote]

    Son, it's called unrolling the logic... uh wait, is that ColdFusion or WebOnAssembly ?



  • Just to be clear: I'm well aware of dozens of other ways to do this. I was just joking about how bad it hurt my brain.



  • Umm, I was just using a figure of speech.



  • The real WTF is ColdFusion Markup Language.

    <CFWTF Spaghetti Readability="0" >


  • Let's remember the difference between the tool and the user. If someone swings a hammer and bashes their thumb, it's not the hammer's fault.

    CF may be a bit outdated, but it can serve as a (relatively easy to use) platform for simple web apps that must be developed by folks who don't quite get AJAX - the right tool (developer?) for the right job.

     



  • Hey, if you think th OP is painful, wait till you see the ensuing Cold Fusion Flame War, or CFFW as it is sometimes known

    but hey, before a moderator comes along and spoils the fun......

    [quote user="snoofle"]

    Let's remember the difference between the tool and the user. If someone swings a hammer and bashes their thumb, it's not the hammer's fault.

    CF may be a bit outdated, but it can serve as a (relatively easy to use) platform for simple web apps that must be developed by folks who don't quite get AJAX - the right tool (developer?) for the right job.

    [/quote]

    Yeah, but if a user uses CF they are a tool you, stinkin a-hole. Only jobs it's good for are "big jobs" as in sht! fcktard!

    .... anybody? anybody?



  • Ah yes, the veterans of the CFFW, the Big One, will never forget it. Those who survived envied the dead. It was so bad, that we are forbidden to even mention that particular programming platform, on pain of torture.

    So if you folks will just line up at the Agony Booth... no need to push, you'll get your turn. 



  • That CFFW was just off the hook. I loved every second of it. Needless to say it was brillant!



  • <font face="tahoma,arial,helvetica,sans-serif">Yeah, and all that 8 pages of flamewar started with the real word... This was TDWTF's greatest FW moment!

    Also, I personally like the "End of <insert topic here> Flamewars" tag...



    </font>



  • [quote user="xrT"]

    <font face="tahoma,arial,helvetica,sans-serif">
    Also, I personally like the "End of <insert topic here> Flamewars" tag...

    </font>

    [/quote]

    have it your way, then *eg*

    <font color="red">_________________________________________________________________________________________________________________________________ </font>

    <font color="red"><font color="red" size="+3">End of The Fabulous Flying Forray Flamewar</font>
    _________________________________________________________________________________________________________________________________</font>

    Any posts mentioning "The Fabulous Flying Forray" will be deleted.

     

     

    just kidding 

     



  • I didn't know I would stir up such trouble by mentioning The Language of Which We Do Not Speak... 🙂

    So really, guys, is this better or worse than the For-Case? I think it's both. It's better in that it's not quite as inherently WTFish, but it's worse in that the For-Case paradigm demonstrates a certain level of programming knowledge which may not be present in the coder of this WTF.



  • I think for-case is a lot worse than this. This WTF is basically down to naivité (assuming switch-case isn't valid in CF; an if-else for this sort of thing where switch-case is available is a WTF); something along the lines of

    switch(val){
    case 1: return "string_for_1";
    case 2: return "string_for_2";
    }

    ... is reasonable for small domain and small data per item. So this WTF is only a WTF of degree, whereas for-case never1 makes sense. A new programmer could easily do this just by not knowing about how to do it right, but the for-case means you have all the tools you need to do it right and still do it the wrong way.

    <font size="-1">1: yes, I know someone will post a way in which they claim it makes sense, but I don't believe you :P.</font>



  • [quote user="Bob Janova"]I think for-case is a lot worse than this. This WTF is basically down to naivité (assuming switch-case isn't valid in CF; an if-else for this sort of thing where switch-case is available is a WTF); something along the lines of

    switch(val){

    case 1: return "string_for_1";

    case 2: return "string_for_2";

    }

    ... is reasonable for small domain and small data per item. So this WTF is only a WTF of degree, whereas for-case never1 makes sense. A new programmer could easily do this just by not knowing about how to do it right, but the for-case means you have all the tools you need to do it right and still do it the wrong way.

    <font size="-1">1: yes, I know someone will post a way in which they claim it makes sense, but I don't believe you :P.</font>

    [/quote]

    Welcome To Finland?

    How is this any better than a for-case? Assuming a switch-case isn't valid, this is the only way to implement a switch case. It's not naivité, it's stupidity. It shows that the person who wrote this code didn't think the problem or the effect of their code through.

    This is a for-if-else-if-else-if paradigm on a defined set of contiguous values. Yucky, offensive, blech! Make it stop. Bring back corporal punishment because death's too good for 'em.



  • Oh, right you are, I missed the loop involved. hangs head in shame. Please disregard my previous post, and the Real WTF is that the control structures in CF are such that I could miss that :P.

     This is indeed just as awful as for-case, then, as it's effectively identical (right? or have I misread the code again?).
     



  • [quote user="snoofle"]CF may be a bit outdated, but it can serve as a (relatively easy to use) platform for simple web apps that must be developed by folks who don't quite get AJAX - the right tool (developer?) for the right job.[/quote]

    I'm not saying ColdFusion isn't useful. I just hate the syntax of ColdFusion Markup Language, which is the only aspect of ColdFusion I remotely know anything about.

    According to Wikipedia though, ColdFusion can be used with ActionScript. Since ActionScript and JavaScript are both based on ECMAScript, and JavaScript is my favorite scripting language, I might really like ColdFusion with ActionScript.

    The syntax of ColdFusion Markup Language still sucks though.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.