• (cs)

    I don't get the last acronym...

    What The F***!?

    Worse Than Failure

    I.... am... confused...

  • Addison (unregistered)

    is it bad that I just realized "worse then failure" works as an alternate meaning for WTF? I should "wake the f***" up!

  • Ray (unregistered)

    Which is worse? The person who hatched this demon spawn, or the next person who looked at it and said "good idea, I'm going to add a bunch more entries"?

  • Hans (unregistered)

    Uhh... Why are the entries in separate fields? Yes, yes, otherwise it wouldn't feature on this website, but apart from that? It looks like the designer wanted to implement a flat file, and is using the primary key to order a separate collection of 'lines'. But why? What business (or mental) case could cause him to split the data up in this form?

    "I'd like to figure out what 'IBM' means. So I will just read the table, in order of primary key, until I find 'IBM', and then I will keep reading until I find an entry that consists purely of X'es. The results up until that point I will concatenate to give the right result."

    Hard to imagine how this happens. But congratulations anyway. It truly is a W.T.F!?

  • (cs) in reply to Ray
    Ray:
    Which is worse? The person who hatched this demon spawn, or the next person who looked at it and said "good idea, I'm going to add a bunch more entries"?
    Without more details, it's hard to know. Sometimes, you inherit code you aren't allowed to change. In that case, adding more entries is sad but understandable. Otherwise...
  • Scott (unregistered)

    Testing each character one by one to see whether it is an "X" or not might seem odd at first until you realize that's how the machine code does it anyway.

    By explicitly calling out the logic you make it more obvious to future readers what's going on, and you also provide opportunities for the compiler to optimize.

  • Jeroen (unregistered) in reply to Ray
    Ray:
    Which is worse? The person who hatched this demon spawn, or the next person who looked at it and said "good idea, I'm going to add a bunch more entries"?
    I think the third person, who decided to use a brilliant delimeter to make it 'easier' to seperate different acronyms in the table
  • (cs)

    Surprisingly, there's no comment of this form yet: 8799 TIAC THIS 8800 TIAC IS 8801 TIAC A 8802 TIAC XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • (cs) in reply to Jeroen

    The data design wtf is somewhat countered (by about 0.2%) by the fact that the designer realised that he was dealing with abbreviations (ABBR), and not acronyms.

  • IT Girl (unregistered) in reply to snoofle
    snoofle:
    I don't get the last acronym...

    What The F***!?

    Worse Than Failure

    I.... am... confused...

    Where I work, someone once commented on a client's file with WTF. I submitted it could have meant "Where's the Form" and argued that this kid was pretty innocent (knowing full well he knew what he was saying).

    When he was called on it by the manager of his department, he answered that it meant "Where's the Followup". The manager bought it.

  • XXXXXXXXXXXXXXXXXXXXXXXXXX (unregistered)

    8799 TIAC THIS 8800 TIAC IS 8801 TIAC A 8802 TIAC COMMENT 8803 TIAC XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Anonymous (unregistered) in reply to Mr B
    Mr B:
    The data design wtf is somewhat countered (by about 0.2%) by the fact that the designer realised that he was dealing with abbreviations (ABBR), and not acronyms.
    Having a basic grasp on English is absolutely no counter for this abomination. This guy is supposed to be a developer, not an English major!
  • (cs)
    Not one to buy into that whole normalization thing, he created a table like the following:

    You obviously aren't familiar with -2nd Normal Form.

  • (cs) in reply to Jeroen
    Jeroen:
    Ray:
    Which is worse? The person who hatched this demon spawn, or the next person who looked at it and said "good idea, I'm going to add a bunch more entries"?
    I think the third person, who decided to use a brilliant delimeter to make it 'easier' to seperate different acronyms in the table
    Maybe the person who p[ut the Xx30 line in weas actually just completing a normal row of Data Entry. How do we know that the original, business defined meaning of LA wasn't "Los Angeles XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"?

    OK, I'll give you that would be a WTF in itself, but who knows...

  • NoAstronomer (unregistered)

    IMHO The "Real WTF" here is why anyone would bother typing in thirty X's when an empty string works just as well as far as the return value from isNotAllXs(...) is concerned.

  • (cs)

    Normally, I wouldn't be so picky, but since it deals with the topic of the WTF: Mensa is not an acronym, nor an abbreviation, initialism, etc. So, it should be in Title Case, not ALL UPPERCASE. </pedantry>

  • Bob (unregistered) in reply to Voodoo Coder
    Voodoo Coder:
    Not one to buy into that whole normalization thing, he created a table like the following:

    You obviously aren't familiar with -2nd Normal Form.

    Irrelevant; he's not talking about Normalisation (capital N) but normalisation in the sense of storing the data in a consistent manner.

  • Bot (unregistered)

    TRWTF is that there's a delimiter at all -- The ABBR_IDX changes when it goes to the next acronym anyway.

  • synp (unregistered) in reply to Hans
    Hans:
    Uhh... Why are the entries in separate fields? Yes, yes, otherwise it wouldn't feature on this website, but apart from that? It looks like the designer wanted to implement a flat file, and is using the primary key to order a separate collection of 'lines'. But why? What business (or mental) case could cause him to split the data up in this form?

    "I'd like to figure out what 'IBM' means. So I will just read the table, in order of primary key, until I find 'IBM', and then I will keep reading until I find an entry that consists purely of X'es. The results up until that point I will concatenate to give the right result."

    Hard to imagine how this happens. But congratulations anyway. It truly is a W.T.F!?

    Dah!

    select ABBR_CDE from table where ABBR_TXT="BUSINESS"

    Gives you all the abbreviations that contain the word business.

    select ABBR_CDE from table where ABBR_TXT="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

    Gives you all the abbreviations that have more than one meaning, and don't get me started with select count + 1

    The possibilites are endless!

  • Peter P. Pedantic (unregistered) in reply to DaveAronson
    DaveAronson:
    Normally, I wouldn't be so picky, but since it deals with the topic of the WTF: Mensa is not an acronym, nor an abbreviation, initialism, etc. So, it should be in Title Case, not ALL UPPERCASE. </pedantry>
    <pedantry>You didn't open the pedantry tag. Validation fails.</pedantry>
  • Death (unregistered)

    Owww... My head hurts. This is retarded beyond repair. Never mind normalization, this structure fails at simplest sanity.

    a) Why on earth are all the elements of the acronyms in separate rows?

    b) A separator in a database? There are no rules on natural order of a relational db. Anything that uses this "separator" needs to do ORDER BY row_id to work for sure...

    c) Checking/storing the "X"-s is retarded waste of space, because you can check if ABBR_IDX is even to get the same info.

    a causes b, b causes c. And they all are solved in a WTF way... Cant believe the massiveness of this stupidity...

  • Anonymous (unregistered)

    <so_very_gay> Geek tags. </so_very_gay>

  • (cs) in reply to Bob
    Bob:
    Voodoo Coder:
    Not one to buy into that whole normalization thing, he created a table like the following:

    You obviously aren't familiar with -2nd Normal Form.

    Irrelevant; he's not talking about Normalisation (capital N) but normalisation in the sense of storing the data in a consistent manner.

    Your humour detector is clearly epic fail.

    What do you call a man with no arms or legs, floating in the ocean?

  • Anonymous (unregistered) in reply to GalacticCowboy
    GalacticCowboy:
    What do you call a man with no arms or legs, floating in the ocean?
    Trevor the Floating Ocean Man?
  • Donal (unregistered)

    In the isThisAllXs function, as it is "retVal = true;", and not "retVal = retval && true;", doesn't it just check to see if the last character in the string is X, or am I having a brain fart?

    Donal

  • Donal (unregistered) in reply to GalacticCowboy

    F*****d.

  • Donal (unregistered) in reply to GalacticCowboy
    GalacticCowboy:
    What do you call a man with no arms or legs, floating in the ocean?

    F****d. (Disregard last)

  • Pony Gumbo (unregistered)

    Best SQL WTF ever.

  • Anonymous Coward (unregistered)

    Wow...this is one of the most mindboggling codeSODs I've read in awhile. Well formatted and cleverly written too.

    Captcha: appellatio - Rejected name and premise for the sequel to American Pie.

  • Anonymous (unregistered) in reply to Donal
    Donal:
    In the isThisAllXs function, as it is "retVal = true;", and not "retVal = retval && true;", doesn't it just check to see if the last character in the string is X, or am I having a brain fart?

    Donal

    retVal will remain false unless any char in the string is not 'X', at which point it is set to true. Therefore, if the loop exits and retVal is true, it must be the case that one or more characters in the string was not 'X' (we don't know which ones or how many, but we know that it was one or more). So the function works, not that it makes today's code any less of a WTF.

  • Amateur (unregistered) in reply to Donal

    No, it works correctly. The assignment triggers if and only if a character which is not an 'X' is encountered, so "false" if returned if no such character exists, and "true" if any does, just as the (somewhat confusing) name of the function indicates.

  • QHS (unregistered)

    A separator when the items are already distinguished by an index? Brilliant!

  • (cs) in reply to Bob
    Bob:
    Voodoo Coder:
    Not one to buy into that whole normalization thing, he created a table like the following:

    You obviously aren't familiar with -2nd Normal Form.

    Irrelevant; he's not talking about Normalisation (capital N) but normalisation in the sense of storing the data in a consistent manner.

    I bet you're just the life of the party. Do you always poop on people's jokes?

  • (cs) in reply to GalacticCowboy
    GalacticCowboy:
    What do you call a man with no arms or legs, floating in the ocean?

    Bob

  • Nis (unregistered) in reply to Donal
    Donal:
    In the isThisAllXs function, as it is "retVal = true;", and not "retVal = retval && true;", doesn't it just check to see if the last character in the string is X, or am I having a brain fart?

    Donal

    It checks whether the string contains any non-X characters. However, instead of break;ing on the first match it continues looking through the rest of the string as well. Which is yet another WTF, since retVal can't change to false anyway.

  • (cs)

    The real WTF:

    "At Chris N.'s employer, they needed the ability to look up acronyms' meanings"

    It's called Google.

  • Ben (unregistered)

    Wait a second.. Isn't that wrong anyway? private static boolean isNotAllXs( String s ) { StringBuffer test = new StringBuffer( s.trim() ); boolean retVal = false; for ( int i = 0; i < test.length(); i++ ) { if ( test.charAt( i ) != 'X' ) { retVal = true; } } return retVal; }

    Wouldn't that mean that a String s which ends with an X would return false too? (which means that it's all Xes) so isNotAllXs("ASDFX"); would return false, just as isNotAllXs("XX[...]XXXX"); Sorry if i'm wrong about that.

  • Mike (unregistered)

    The Real WTF for me is that I didn't even know the Sega Nomad existed! Seriously, a handheld that can take Genesis/Megadrive carts direct? WTF? Where the hell was I in the mid 90s and why didn't I get a memo about this?

  • (cs)

    The codez will fail for the AXMD (Association of XXX Movie Directors).

    A workaround for this would be to check whether the delimiter has an even ABBR_IDX.

  • Anonymouse (unregistered) in reply to Mike

    It's hardcore XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • rmz (unregistered) in reply to Mike
    Mike:
    The Real WTF for me is that I didn't even know the Sega Nomad existed! Seriously, a handheld that can take Genesis/Megadrive carts direct? WTF? Where the hell was I in the mid 90s and why didn't I get a memo about this?
    You probably missed the three months in which they were on sale.
  • (cs) in reply to rbonvall
    rbonvall:
    The codez will fail for the AXMD (Association of XXX Movie Directors).

    A workaround for this would be to check whether the delimiter has an even ABBR_IDX.

    It wouldn't fail on AXMD. Take a closer look at it...it actually works pretty well for to check for an all-x string. Even if the last character were X it would work fine...

  • Mike Seth (unregistered) in reply to Voodoo Coder
    You obviously aren't familiar with -2nd Normal Form.

    You win the debate.

  • welshie1988 (unregistered) in reply to Ben
    Ben:
    Wait a second.. Isn't that wrong anyway? private static boolean isNotAllXs( String s ) { StringBuffer test = new StringBuffer( s.trim() ); boolean retVal = false; for ( int i = 0; i < test.length(); i++ ) { if ( test.charAt( i ) != 'X' ) { retVal = true; } } return retVal; }

    Wouldn't that mean that a String s which ends with an X would return false too? (which means that it's all Xes) so isNotAllXs("ASDFX"); would return false, just as isNotAllXs("XX[...]XXXX"); Sorry if i'm wrong about that.

    You are wrong. The loop starts, the first character is 'A', which != 'X', so retval = true.

  • evilspoons (unregistered) in reply to Quango
    Quango:
    The real WTF:

    "At Chris N.'s employer, they needed the ability to look up acronyms' meanings"

    It's called Google.

    In today's fast-paced world of cell phones, Sega Nomads, and turn signals, we don't have time for anything.

    I took this to mean that this article was supposed to take place some time around 1995, which really made the whole 'internet' thing kind of a disaster. I'd have considered an offline acronym database a useful tool (if I wasn't ten years old at the time.)

  • Ben (unregistered) in reply to welshie1988

    But retval is not being returned at that point. The loop continues, checks a few more letters which will keep retval being true. Then the last letter, which is an X. So retval becomes false, the loop ends and retval is returned..

  • Nath3an (unregistered)

    The real WTF is that IBM, LA, WCAB and WTF are not acronyms. They are abbreviations.

  • Topcod3r Jr (unregistered) in reply to Scott
    Scott:
    Testing each character one by one to see whether it is an "X" or not might seem odd at first until you realize that's how the machine code does it anyway.

    By explicitly calling out the logic you make it more obvious to future readers what's going on, and you also provide opportunities for the compiler to optimize.

    Dad, is that you?

  • (cs) in reply to Ben
    Ben:
    Wait a second.. Isn't that wrong anyway? private static boolean isNotAllXs( String s ) { StringBuffer test = new StringBuffer( s.trim() ); boolean retVal = false; for ( int i = 0; i < test.length(); i++ ) { if ( test.charAt( i ) != 'X' ) { retVal = true; } } return retVal; }

    Wouldn't that mean that a String s which ends with an X would return false too? (which means that it's all Xes) so isNotAllXs("ASDFX"); would return false, just as isNotAllXs("XX[...]XXXX"); Sorry if i'm wrong about that.

    If you're trolling, then way to go, but otherwise, yes, you are wrong about that. retVal is initialized to false, and as soon as any one character is NOT AN X, it is set to true. No where in the code does retVal get set back to false if there is an X. The only WTF is that the code should look more like this:

    private static boolean isNotAllXs( String s )
    {
       StringBuffer test = new StringBuffer( s.trim() );
    
       for ( int i = 0; i < test.length(); i++ )
       {
          if ( test.charAt( i ) != 'X' )
          {
             return true;
          }
       }
          return false;
    }
    

    That way as soon as a non-X is found, the comparison is done instead of checking a bunch of chars that don't matter anymore...

    Addendum (2008-12-08 11:03): EDIT: Oh yea, one more thing, before ANY characters are checked, there should be a check to see if length == delimiter length, but since the rest of the code is so great, and this function is named "isNotAllXs" I'm assuming that the length check was done before this function is even called...

    (The post after this reminded me...)

  • AXMD Director (unregistered) in reply to Voodoo Coder
    Voodoo Coder:
    rbonvall:
    The codez will fail for the AXMD (Association of XXX Movie Directors).

    A workaround for this would be to check whether the delimiter has an even ABBR_IDX.

    It wouldn't fail on AXMD. Take a closer look at it...it actually works pretty well for to check for an all-x string. Even if the last character were X it would work fine...

    Ok, let's got step by step: first row gets "Association", second row gets "of", third row gets "XXX" - oops!

Leave a comment on “Thirty X's”

Log In or post as a guest

Replying to comment #233483:

« Return to Article