• Unklegwar (unregistered) in reply to Volmarias

    Volmarias:
    Ah, brillant. It's been a while since we've had a delightful smorgasbord of code snippets. These are all fortunately more hillarious than horrid.

    I particularly like how Sunday is Admin day. I suppose they decided that it would be more empowering than Casual Fridays.

     

    All they need now is earlybird specials, and people will show up to work early, just to hose the system.

     

  • (cs) in reply to Oliver Klozoff
    Oliver Klozoff:
    Anonymous:

    14 year old humour - I work with a database called "MasterData". Not that funny if you are Kiwi like my colleagues, as they pronounce data the American way (First syllable rhymes with bar). However, I'm from the UK and for me it rhymes with day. Try saying it my way, out loud...

     What Americans are you talking about? I've always pronounced it "day tuh". 
     

    He's obviously talking about Bostonians ...

    where "park the car in Harvard yard" is pronounced more like "pawk da cah in Hawvuud yawd", "water" is pronounced more like "watuh", "Worcester" is pronounced more like "woostuh", and "data" is pronounced more like "dater".

     

  • Stoffel (unregistered) in reply to Balthazaar

    I'm getting too old. The only one that made me LOL was the try/catch with the same exact code.  That's awesome.  I wish I had 14-yr-old humor again.

     

    CAPTCHA: awesomeness

     

  • (cs) in reply to Stoffel
    Anonymous:

    The only one that made me LOL was the try/catch with the same exact code.  That's awesome.

    I know an ERP system which requires such a stubborness: The first call to some API returns (under some circumstances) NOK (not ok), with some warning message; calling the same API again works.

  • (cs) in reply to BradC
    BradC:
    Anonymous:

    I always wanted to create a help desk system called "My Pants Your Mom". 

    Support: "Hmm, I've never heard of that. Let me search my pants Your Mom and see what I can find."

    Support:  "I'm sorry, My Pants Your Mom is down, so I can't answer your question."

    Support:  "I seem to recall seeing something about that in My Pants Your Mom."

     The 14 year old humor possibilities are endless!

    Lol, nice.

    Support: "Please hold. Sysadmin Julia currently has My Pants Your Mom down for servicing."

    Support: "I'm sorry, My Pants Your Mom is a little slow today..."

    Support: "I'm sorry, I can't seem to find that in My Pants Your Mom."

     

     

     
    nice, but you must be a little older than I, guess you wanted to keep it "clean". I used to worked with a guy, wo was in his 20s, who thought it was funny to comeback with the "Your Mom" statement after everything you said. Now your into the humor of today!

     
    sry just had to post it!

  • blasterz (unregistered) in reply to anonymous
    Anonymous:
    pjsson:

    Volmarias:
    I particularly like how Sunday is Admin day. I suppose they decided that it would be more empowering than Casual Fridays.

    I guess no regular users will use the application on Sundays, so it is safe to assume that anyone using the application on a Sunday is an admin. At least until some user figures out if he changes the date of the PC clock to Sunday then you will get full admin privileges.

     I interpret it as, anyone working on Sunday must need to get work done, and doesn't have time to screw around with potential permission issues, or getting hold of an admin to grant him permissions. 

    (Our non-admin users do not have the privilege to change the clock, so, we don't have to worry about the problem you describe.  We only have to worry about them coming in on Sundays.)

    I worked in a place where they thought locking out the GUI interface for setting the clock was the same thing as taking away the privilege to change the clock...
     

  • Sam (unregistered) in reply to Reed
    Anonymous:

    On a really basic intellectual level, programming is about coming up with elegant ways to describe things that happen.  Remember, always name it what it's *for*, and *why it exists* not what exactly it does! Otherwise, why bother with any kind of structured high-level programming?
     

    Reed 

     

    BradC:
    Alex Papadimoulis:

    I'm sure a lot of you would have mocked Josh's collegue for having a constant named COMMA. Ha! Who's laughing now?

    #define COMMA "|"

    Beautiful in its simple WTF'ery.

    Probably this should be something like

    #define DELIMITER "|"

    Pro

     

    Wow, I might know where this comes from.  I'd been working with a trading systems vendor who'd promised to give us post-trade date files daily so we could insert the data into our database.  They said their standard format was csv files, and when I asked if they were actually csv's (some use "csv" as shorthand for "delimited").  They stared a second and said yes, of course.  I was a little annoyed -- I'm not a big fan of true csv's for data transmission which will include textual data.  But we had code that would parse true csv's, so we said agreed.

     The first sample file didn't parse correctly.  There were different numbers of fields for each record.  Lo and behold, there were embedded commas in the data, and no double-quoting.  No, this isn't the wtf yet.

     I went back and told them this, and they said they'd spend a few days working on it.  After a week or two, they came back to me with their first suggested solution:  move the text fields (there was more than one) which might have commas in it to the end of the record layout.  When I pointed out that we actually want that data and moving those fields to the end doesn't really help, they promised to work on it some more.  At this point I suggested using pipes instead, but they demurred, saying csv's were their standard format.  (I'd consider this sequence, particularly their "solution", wtf 1).

     Some time later, they copied me on an email instructing their dba's to remove all commas from all data in specified columns of their database.  I had done enough espionage to know that their request wouldn't have just affected us (as bad as that would have been), but would have affected ALL their customers.  I was sorely tempted to agree just to witness the havoc that would ensue.  In the end, though, I did the right thing and told them that was no good -- we wanted the commas in the data that had commas.  They promised to work on it and give us real csv's. (I'd consider this wtf 2).  By this point, I told the salesperson who'd sold us the product that there was no way any of their other customers are actually using the files, and he agreed.  Too bad IT had no say in whether the product was used.

    After I complained at a meeting about their inability to produce usable files after several weeks, they went on the offensive.  One of their supposedly technical people sent an email claiming there was no problem with the file format, the problem was with "the way you open it in Excel".  At this point, I got pretty pissed, responding with something to the effect of, "Excel has nothing to do with it; we don't process it in Excel, and you don't make it in Excel -- because if you did, it would have been RIGHT!"  Except it was a lot longer and more acerbic, and came much closer to accusing them of outright lying and/or stupidity.  The next four people I met from that company opened their eyes very very wide when I introduced myself.  >:)

     At that point, they agreed to send the files pipe-delimited.  It wouldn't surprise me in the slightest if they'd redefined their "COMMA" constant to "|".

     Needless to say, when the product went live we had tremendous issues with data quality, connectivity, application configuration/installation, etc. But, the files were at least formatted in a usable manner.

     

  • Sam (unregistered) in reply to Botia

    Anonymous:
    How many of you counted the spaces?  :)

     H:\>perl -e "print length(\"                         \");"
    25
    H:\>

     

  • Scurvee (unregistered) in reply to Jan

    lSend = (lSend = True)

    Works fine in VBScript... probably would have worked in VB6 as well.

     

     Captcha: quality  ....seriously

  • Bastardo Anónimo (unregistered) in reply to mrsticks1982

    I worked on an intranet which had an achronym of PAM... the CEO thought it was hillarious when he said he was "In Pam last night."

  • huhuhuhuhu..huhu (unregistered) in reply to savar
    savar:

    yayyyyy!!

    code WTFs -- lots of them!

    i guess i'll have to stop complaining. what am i going to do with my time now?

     

     

    Imagine the Battlestar Galactica chicks making out.

     

    Or am I the only one who does this?

     

    [captcha=photogenic] Yes they are. 

  • (cs) in reply to Bradlegar the Hobbit

    No, no. They just redefined twenty as twenty-five.

  • AN (unregistered) in reply to Sam

    You have to do all that?

     

    irb(main):001:0> "                         ".length
    => 25
  • (cs)
    Alex Papadimoulis:

    Matt Spicer was in the middle of a VB6 to C# conversion projection and stumbled across this next snippet. He decided to not bring this line of code to the new project ...

    lSend = IIf(lSend = True, True, False)

     

    Wow, it's like a repeat of A False Detector:

     


    <font>public boolean</font> checkFalse(<font>Boolean</font> bool)
    {
    <font>if</font> (bool.booleanValue() == <font>Boolean</font>.<font>FALSE</font>.booleanValue())
    {
    <font>return</font> <font>Boolean</font>.<font>FALSE</font>.booleanValue();
    }
    <font>else</font>
    {
    <font>return</font> <font>Boolean</font>.<font>TRUE</font>.booleanValue();
    }
    }

     

     

    (This is my favorite WTF yet... I laughed for about 5 minutes almost solid. My sides were hurting when I was done.)

  • sjs (unregistered) in reply to Botia

    % ruby

    puts "                         ".length
    ^D
    25

  • Anonymous (unregistered) in reply to sjs

    I think a good contest would be to see who can come up with the most overengineered solution to count the actual number of spaces in that "TwentySpaces" string.

     GO!  I'd better see some XML and web services.

  • Oipoistar (unregistered) in reply to John Meikenson

    I love this small "currently not thinking - just working" things.

    I still remember my first:   if(true) 

  • PiLLe (unregistered)

    int return_space_count(std::string spaceString) { return 25; // hrhr }

  • (cs)

    F.S. noticed that Australian airline JetStar is very careful about ensuring visitors are sent to the proper page ...

    if ((version=="NS") || (version=="IE")) 
    {
    if (version=="NS")
    /* NS URL */
    window.location="/skylights/cgi-bin/skylights.cgi";
    else
    /* IE URL */
    window.location="/skylights/cgi-bin/skylights.cgi";
    }
    else
    /* OTHER URL */
    window.location="/skylights/cgi-bin/skylights.cgi";

     Maybe they initially wanted to make different pages for these browsers, and this code was accidently not removed after someone decided making different pages was too complicated/time-consuming/expensive/whatever.

  • jrrs (unregistered) in reply to Sam
    Anonymous:

    Anonymous:
    How many of you counted the spaces?  :)

     H:\>perl -e "print length(\"                         \");"
    25
    H:\>

    I copied the string contents into the emacs "*scratch*" buffer and ran shell-command-on-buffer, "wc". ;-)

  • (cs) in reply to Colin McGuigan

    Colin McGuigan:
    MakeCum reminds me of one of my earlier efforts, when I had to work on a fund accrual generation system, or the FAG system, which consisted of FAG customers, FAG products, FAG rates, etc...

     

    Of course, trying to create meaningful server names can also lead to these types of problems. I remember a Microsoft Exchange server that was being built for a mailbox restoration while I was at ISS...ah, yes. It was called ISSEXREST

     

  • (cs) in reply to science_gone_bad
    Anonymous:

    Or even better, the system I worked on named by the Marketing Wonks:

    CRP

     Had us laughing for an hour since we definitely had the fastest CRP around

     

     

    This actually reminds me of one a former coworker told me about. He was on the Solomon support team. The queue in the support ticket system was SOL 

  • (cs) in reply to Rob
    Anonymous:

    I always wanted to create a help desk system called "My Pants". 

    Support: "Hmm, I've never heard of that. Let me search my pants and see what I can find."

    Support:  "I'm sorry, My Pants is down, so I can't answer your question."

    Support:  "I seem to recall seeing something about that in My Pants."

     The 14 year old humor possibilities are endless!

     

    Try this one on: A group of people whose job it is to make sure business requests for IT services make sense and are possible. We would call it the Business/Information Technology Clearing House.

     "Hey, can we do that? Did the BITCH clear it?

    "Have you asked the BITCH if we have the money for that?"

    "Can't go to lunch...got a 1 o'clock BITCH session"

    "I used to work in that group...now I guess I'm just a son of a BITCH"

     
    Yeah, I could go on forever.
     

  • Wayne Newton, IV (unregistered) in reply to sjs

    How about a Python version while we're at it:

    > python -c "print len('                         ')"
    25

    or

    > python
    >>> len('                         ')
    25

  • Wayne Newton, IV (unregistered) in reply to Anonymous
    Anonymous:

    I think a good contest would be to see who can come up with the most overengineered solution to count the actual number of spaces in that "TwentySpaces" string.

     GO!  I'd better see some XML and web services.

     

    OK, just a preliminary attempt at a data representation here. Maybe someone can build on this.

    <string>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
        <char value=" "/>
    </string>
     

     
    Captcher == "error" -> True

  • rob_squared (unregistered) in reply to Rank Amateur
    Rank Amateur:
    Alex Papadimoulis:

    F.S. noticed that Australian airline JetStar is very careful about ensuring visitors are sent to the proper page ...

    if ((version=="NS") || (version=="IE")) 
    {
    if (version=="NS")
    /* NS URL */
    window.location="/skylights/cgi-bin/skylights.cgi";
    else
    /* IE URL */
    window.location="/skylights/cgi-bin/skylights.cgi";
    }
    else
    /* OTHER URL */
    window.location="/skylights/cgi-bin/skylights.cgi";
    I'm outraged. What about Opera? You can't have Opera browsers going to 
    /skylights/cgi-bin/skylights.cgi! Clearly you have to direct them to 
    /skylights/cgi-bin/skylights.cgi! This is browser discrimination!
    --Rank

     

    Forget opera, what about lynx!  I hope telnetting to port 80 is ok though... 

  • Tub (unregistered) in reply to rob_squared

    Anonymous:
    I hope telnetting to port 80 is ok though...

    oh, that'd need more than just javascript.

     

    <!-- if you're using telnet, please browse to /skylights/cgi-bin/skylights.cgi -->

  • Dazed (unregistered) in reply to Solo
    Anonymous:
    Anonymous:
    This looks to me like the developer just needed a place to stick a breakpoint so he could start stepping through the code when it got to customer #7742, so he could figure out why it was failing for that customer. At least, that's why *I've* written code like this.
    I do it too, but I don't let anyone know. I clean up after myself. The next thing you know, another drone is poking through the files checked in with my name on it looking for that kind of thing :)

    Well indeed. And just in case one forgets to remove an instance, a "// debug" comment takes two seconds to enter and is simple politeness to the next developer who comes along.

  • john yaya (unregistered) in reply to Chaz
    Anonymous:

    14 year old humour - I work with a database called "MasterData". Not that funny if you are Kiwi like my colleagues, as they pronounce data the American way (First syllable rhymes with bar). However, I'm from the UK and for me it rhymes with day. Try saying it my way, out loud...

     
    That's almost as good as a milestone I had on a project once called the MasterBeta. 
  • Monty (unregistered) in reply to firedup
    firedup:

    A few projects back I worked with a girl 3 months out of school. We had some coding style rules, one of which was 'descriptive variable names'. Instead of, as you suggest, "DELIMITER", she used something like: "THE_CHARACTER_THAT_SEPARATES_FIELDS_IN_THE_PARAMETER_STRING".

     

    There's no way a girl of 3 months should be in school yet anyway. I guess that's the real WTF here.
     

  • (cs)
    If .Fields("CUST_NUM") = "7742"; Then
     dtmOrderPlaced = dtmOrderPlaced 
    End If 
    
    foreach (CxNode node in nodeList) { 
      object[] ndArgs = buildArgs(node); 
      try { 
        sb.AppendFormat(node.Output, ndArgs);
      } catch(Exception) {
        sb.AppendFormat(node.Output, ndArgs); 
      } 
    } 
    

    These two, are in my opinion results of the same problem : inability to debug. I'm forced to use the second aproach when debugging under Windows CE emulator, because after the exception is thrown you cannot recreate it by using "Set Next Statement", so the only way is to repeat the call that caused exception in catch block - this time debugging step by step.

  • Kim (unregistered) in reply to Wayne Newton, IV

     <char value=" "/> doesn't cut it. It's not exactly Enterprise-quality...

     Use <character encoding="ISO-8859-1"><codepoint source="unicode"><integer format="hexadecimal">20</integer></codepoint></character>

    (Captcha: "error". Something wrong with your system?)

  • Cobra (unregistered) in reply to Volmarias

    Far more empowering! After all, Sunday and Saturday are the strongest days, the other five being, of course, Week Days... ;)

  • Cobra (unregistered) in reply to Volmarias
    Volmarias:
    Ah, brillant. It's been a while since we've had a delightful smorgasbord of code snippets. These are all fortunately more hillarious than horrid.

    I particularly like how Sunday is Admin day. I suppose they decided that it would be more empowering than Casual Fridays.
    Far more empowering! After all, Sunday and Saturday are the strongest days, the other five being, of course, Week Days... ;)
  • Cobra (unregistered)

    Alex Papadimoulis:

    public class MakeCum {

      public static void main(String[] args) {
    ...
    CLArgParser clap = new CLArgParser(clargs);

    boolean err = clap.doStdArgs(args);

    if (err) {
    System.out.println("Usage: MakeCum ");
    System.out.println(clap.getStdArgsDescription());
    return;
    }
    ...}
    Ah... reminds me of a report I had to do at a former job. 
    My boss was very fond of 8.3-style names, so everything (from table names to file names) had that naming format in the company (not necessarily with only 8 characters for names, but with no spaces or special characters whatsoever). One day, he asked me to build a report that returned analytic data. 
    The name of the file? AnalReport. Try keeping a straight face and hold the laughter when the client calls you (as they always do, no matter what) to say that "this AnalReport stinks"...
     
    Captcha: bedtime (should have been, but wasn't...) 
  • jdoff (unregistered) in reply to Wayne Newton, IV
    dev:~> echo "                        " | wc -m
    25
    dev:~>
    
  • (cs)
    Alex Papadimoulis:

    For those of you with a maturity level greater than "14 years old", this next snippet probably won't be for you. Thankfully, Brian Samson isn't one of those people ..

    public class MakeCum {

    public static void main(String[] args) {
    ...
    CLArgParser clap = new CLArgParser(clargs);

    boolean err = clap.doStdArgs(args);

    if (err) {
    System.out.println("Usage: MakeCum ");
    System.out.println(clap.getStdArgsDescription());
    return;
    }
    ...}

     

    The Real WTF(tm) here, of course, is that they use System.out instead of System.err to print error message, and use return rather than System.exit() to signal a failure condition

  • bbum (unregistered) in reply to BradC

    Nahh... more like:

     
    #define PANDABUTT 0x7c

  • (cs) in reply to WWWWolf
    WWWWolf:
    Alex Papadimoulis:

    For those of you with a maturity level greater than "14 years old", this next snippet probably won't be for you. Thankfully, Brian Samson isn't one of those people ..

    public class MakeCum {

    public static void main(String[] args) {
    ...
    CLArgParser clap = new CLArgParser(clargs);

    boolean err = clap.doStdArgs(args);

    if (err) {
    System.out.println("Usage: MakeCum ");
    System.out.println(clap.getStdArgsDescription());
    return;
    }
    ...}

     

    The Real WTF(tm) here, of course, is that they use System.out instead of System.err to print error message, and use return rather than System.exit() to signal a failure condition

    Not completely true. The problem is that there could (should) be a command line option like "-h" that shows the usage info; if this option is given, output should go to System.out. Therefore we are facing the problem that the return code of CLArgParser.doStdArgs() must represent three possible values: "success", "failure" and "help requested". It should be ovious for all regular readers of this site how to solve that:

    enum Bool 
    {
    True,
    False,
    HelpRequested
    };

     

     

  • Loren Pechtel (unregistered)
    Alex Papadimoulis:
    Talk about customer service! Josh's company really makes sure that Customer #7742's order date is ... well ... Customer #7742's order date ...
    If .Fields("CUST_NUM") = "7742" Then
    dtmOrderPlaced = dtmOrderPlaced
    End If
     What's the big deal here?  This is just a conditional breakpoint in code.  When you want a breakpoint on something this complex, what else are you going to do? 

    F.S. noticed that Australian airline JetStar is very careful about ensuring visitors are sent to the proper page ...

    if ((version=="NS") || (version=="IE")) 
    {
    if (version=="NS")
    /* NS URL */
    window.location="/skylights/cgi-bin/skylights.cgi";
    else
    /* IE URL */
    window.location="/skylights/cgi-bin/skylights.cgi";
    }
    else
    /* OTHER URL */
    window.location="/skylights/cgi-bin/skylights.cgi";
     
    In other words, a standard template. 
     

    Matt Spicer was in the middle of a VB6 to C# conversion projection and stumbled across this next snippet. He decided to not bring this line of code to the new project ...

    lSend = IIf(lSend = True, True, False)

     

    A trap for corrupt data.    

  • RoxChkPlusOny (unregistered)

    I would actually use code like F.S. presented in the midst of developing. The idea would be to set that up so it's usable immediately, and then iteratively work through making NS- and IE-compatible websites. Only when they were testable would i change the URLs to point to them. However, in this particular example I would probably put the logic in the CGI code, not in the Java...

  • (cs) in reply to RoxChkPlusOny
    Anonymous:
    However, in this particular example I would probably put the logic in the CGI code, not in the Java...


    ...Script. JavaScript. Not Java.

    Honestly now.
  • (cs)

    Source potpourri, what delight

  • Timmy (unregistered)

    Paula Bean...where are you?!?

  • (cs) in reply to Sam
    Anonymous:

    Anonymous:
    How many of you counted the spaces?  :)

     H:\>perl -e "print length(\"                         \");"
    25
    H:\>

     


    <font face="courier new,courier">C:\> osql -E -Q "select datalength('                         ')"

    -----------
             25</font>

    <font face="tahoma,arial,helvetica,sans-serif"><font face="courier new,courier">(1 row affected)

    C:\>
    </font>
    I could have made an app that "shelled" query analyzer then just "send keys" these query, send "F5", send another set of keys to highlight the result, send "CTRL+C", "shelled" notepad.exe, send "CTRL+V", send "ALT, F, S, C:\result.txt, ENTER", then in the same app, read the contents of result.txt, "val"-ed it and put the final result in a messagebox. But I'm a bit lazy today...

    Oh wait...



    </font>

  • drx (unregistered)

    Yo DailyWTF, your RSS feed got bad recently. Since the ads are always changing, my feedreader reports that the items have been edited and marks them as unread. It might be worth a discussion if the feedreader is WTFed or your feed ... but i think you could change yours easily ... And my opinion is that your feed is WTFed :)

  • yoyo42 (unregistered) in reply to Cobra

    "The name of the file? AnalReport. Try keeping a straight face..."

     My company had an incredible time code system:  0.1 hour resolution (so 7h45m fridays were tricky...), a whole deep hierarchy of codes for administrivia work but only one 'customer project' code, that sort of thing. Then they upgraded it to at least allow customer tasks to be broken down a little further. Except that there was only a very short text field for the description.

    Is your current activity customer-related analysis work? Then just put your hours down against 'Anal Acts'... 

  • sk (unregistered)

    most clueless way of counting the spaces ....


    <?php

    $howMushSpacesIsOutThere = 0;
    $countSpacesInThisWord = " ";

    while ( ($countSpacesInThisWord{$howMuchSpacesIsOutThere} != '' ? ++$howMuchSpacesIsOutThere : 0)) ;

    print $howMuchSpacesIsOutThere . "\n";


    ?>

    speaking of devil captcha: clueless, really!

  • HardCoder (unregistered) in reply to Jojosh_the_Pi
    Jojosh_the_Pi:
    Alex Papadimoulis:
    int doctrackId = Convert.ToInt32("0");  //wtf!!



    Maybe the programmer was concerned the int would be initialized with 64 bits, so he used this to try to specify a 32 bit integer, thus conserving memory.

    wtf!!

    CAPTCHA Test

     

  • piersy (unregistered) in reply to Karl von L.

    I suppose it's just possible that there was som logic embedded in a trigger or something, which would be something of a wtf in itself if this was the way they went about applying said logic.

Leave a comment on “Coded Smorgasbord: The Pilot Episode”

Log In or post as a guest

Replying to comment #:

« Return to Article