• Albertini Albertino (unregistered)

    In that vein, then - coming soon, TDWTF...2.

  • Zeroth? or 'A'th? (unregistered)
    there's always room for expansion. If you need another column, just add a new one, adding one to the highest 'f column'.
    Not so fast hotshot. What happens when you run out of numbers? Should have at least used hex, if not the entire alphabet, to buy more time.
  • Richard (unregistered)

    Hey, don't knock it, Alex does the same thing here with comments. Notice how each comment gets an incrementing number? The code looks something like this:

    update wtf.article set c1440513 = 'In my country...' where article=1961720010330;

    (Of course I'm assuming each comment is another column in the article row. That way you can fetch them all at once instead of having to loop through SELECT results.)

  • (cs)

    FINALLY... a REAL WTF! It has been days since I had a good vomit!

    I wish I could see the entire workflow that made it necessary to update a single row, one column at a time :p. I am guessing it was tied to the onchange event on an html form, causing an ajax post every time a form element value was modified. Would be interesting to see if this "ENGINEER" had bothered to sanitize the input.

  • Codd (unregistered)
    update tmp set f7 ='Somestreet' where f0=1961720010330; update tmp set f8 ='123' where f0=1961720010330; update tmp set f9 ='1001' where f0=1961720010330; update tmp set f10 ='AA' where f0=1961720010330; update tmp set f11 ='SOME CITY' where f0=1961720010330;
    Obviously this is a data entry screen where the user is filling out a form. You want to save each value as they enter it instead of waiting for the end and possibly losing everything due to a power failure or whatever.
  • (cs) in reply to Richard
    Richard:
    Hey, don't knock it, Alex does the same thing here with comments. Notice how each comment gets an incrementing number? The code looks something like this:

    update wtf.article set c1440513 = 'In my country...' where article=1961720010330;

    (Of course I'm assuming each comment is another column in the article row. That way you can fetch them all at once instead of having to loop through SELECT results.)

    hey... don't pick on Alex. If he wants to go to huge lengths just to wtf us with HTML comments... then that just shows his level of committment to fuckery!

  • Bobby (unregistered)

    Well at least if there's an SQL injection hole (and there most likely is) you don't have to worry about the hacker figuring out your data structure when he downloads your database.

  • (cs) in reply to Codd
    Codd:
    update tmp set f7 ='Somestreet' where f0=1961720010330; update tmp set f8 ='123' where f0=1961720010330; update tmp set f9 ='1001' where f0=1961720010330; update tmp set f10 ='AA' where f0=1961720010330; update tmp set f11 ='SOME CITY' where f0=1961720010330;
    Obviously this is a data entry screen where the user is filling out a form. You want to save each value as they enter it instead of waiting for the end and possibly losing everything due to a power failure or whatever.

    yea... because then if there really is a power failure... all the person updating the form has to do to finish up is remember that the ID is 1961720010330, and know where to put it to prepopulate his old data. How hard can that POSSIBLY be?

  • Carl (unregistered)
    update tmp set f75 ='' where f0=1961720010330;
    Yeah, because it we didn't set it to '' it would have defaulted to, um, what? Blank?
  • (cs) in reply to Carl
    Carl:
    update tmp set f75 ='' where f0=1961720010330;
    Yeah, because it we didn't set it to '' it would have defaulted to, um, what? Blank?

    NULL

  • Easy (unregistered) in reply to Some Jerk
    Some Jerk:
    Codd:
    update tmp set f7 ='Somestreet' where f0=1961720010330; update tmp set f8 ='123' where f0=1961720010330; update tmp set f9 ='1001' where f0=1961720010330; update tmp set f10 ='AA' where f0=1961720010330; update tmp set f11 ='SOME CITY' where f0=1961720010330;
    Obviously this is a data entry screen where the user is filling out a form. You want to save each value as they enter it instead of waiting for the end and possibly losing everything due to a power failure or whatever.

    yea... because then if there really is a power failure... all the person updating the form has to do to finish up is remember that the ID is 1961720010330, and know where to put it to prepopulate his old data. How hard can that POSSIBLY be?

    You are clearly failing to grasp this design pattern. This can easily be fixed using the following:

    update allvars set f1903 = 1961720010330 where rowname = 'users_last_active_row';

  • (cs)

    This is not a WTF:

    • these are query logs. there may be comments in the code, and this is out of context, so maybe this makes more sense in context
    • Yes, it's a silly "clever" trick someone thought was a good idea at the time when there's like a much better way, but:
    • even the OP admits to clearly knowing which fields were zip codes, even when the fields changed and so on
    • there weren't any maintenance issues. it did its job for as long as it needed to
    • and it got replaced with something more sensible before it became a problem
  • (cs)

    O man, this is so inefficient. I've already described the db on which I had the pleasure to work: it had a similar design, but had a "vtypeid" which indicated how to interpret the row of data. Obviously, there were vtypeids that overlapped.

    However, it was way more efficient than this one. We had 5 columns, and didn't have to add columns, we just added another row with a different vtypeid and then ... (wait for it) ... joined multiple queries that shared the same source id and timestamp. If the above design made someone vomit, this one will have him slash his wrists (remember: across the arm, not across the wrist).

    That didn't hinder anyone in creating databases with 4, 9 or 13 columns, of course. It did hinder everyone though in writing portable queries.

  • Evoex (unregistered)

    I like the Dutch word "bestaand" in there, which means "existing". As a string...

  • (cs)

    This reminds me of a company standard from a former job, to add an extra 10 parameters to every asp/vbscript function just in case they will be used later. As a result, you would have:

    function chokeYourself(secondsToDeath, numberOfHands, parameter3, parameter4, parameter5, parameter6, parameter7, parameter8, parameter9, parameter10, parameter11, parameter12) ... code end function

    then, if you decided you wanted to specify the number of spectators later, you could simply substituted the name "parameter3" for "numberOfSpectators" without breaking any of the function calls. The vbscript (obviously) would already be expecting the correct number of parameters, so nothing could possibly go wrong... right?! <YAKKK!>

  • Wonk (unregistered) in reply to jonnyq
    jonnyq:
    This is not a WTF: - these are query logs. there may be comments in the code, and this is out of context, so maybe this makes more sense in context - Yes, it's a silly "clever" trick someone thought was a good idea at the time when there's like a much better way, but: - even the OP admits to clearly knowing which fields were zip codes, even when the fields changed and so on - there weren't any maintenance issues. it did its job for as long as it needed to - and it got replaced with something more sensible before it became a problem

    oh, how I miss TopC0der.

  • Another Jerk (unregistered)

    I'm always wanting to use the most cryptic parameter names possible to that nobody will be able to follow what I have done.

  • (cs) in reply to Another Jerk
    Another Jerk:
    I'm always wanting to use the most cryptic parameter names possible to that nobody will be able to follow what I have done.

    a design pattern something like this?:

    public class enum1 { public enum VOID { ZERO = 2 ONE = 0 TWO = 1 } public int StringProperty1 {get; set;} public string IntProperty2 {get; set;} public VOID Event( string boolValue ) { if( boolValue == "ZERO" ) return VOID.ONE; else throw new NullReferenceException( "YOU SUCK!" ); } }

  • (cs)

    There's always room for another thousand columns. As long as you can store the data somehow, somewhere, you're good.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered)

    TRWTF is not knowing the difference between a database and a spreadsheet. Or PHP.

  • Double Click (unregistered)

    I am not sure If this is WTF or not. I just happen to stumble on it.

    Try double click on the code in the article. And see what happens.

    BTW I am using FF14 on Win7 64bit

  • Another (unregistered) in reply to Some Jerk
    Some Jerk:
    This reminds me of a company standard from a former job, to add an extra 10 parameters to every asp/vbscript function just in case they will be used later. As a result, you would have:

    function chokeYourself(secondsToDeath, numberOfHands, parameter3, parameter4, parameter5, parameter6, parameter7, parameter8, parameter9, parameter10, parameter11, parameter12) ... code end function

    then, if you decided you wanted to specify the number of spectators later, you could simply substituted the name "parameter3" for "numberOfSpectators" without breaking any of the function calls. The vbscript (obviously) would already be expecting the correct number of parameters, so nothing could possibly go wrong... right?! <YAKKK!>

    And this, ladies and gentlemen, is why the gods gave us perl.

    sub chokeYourself { my ($secondsToDeath, $numberOfHands) = @_; ... }

    Caller passes extra params? No problem. Update sub to receive $numberOfSpectators, but some callers don't know? No problem again. Just make sure the sub's code gracefully deals with a null $numberOfSpectators.

  • Neil (unregistered) in reply to Double Click
    Double Click:
    I am not sure If this is WTF or not. I just happen to stumble on it.

    Try double click on the code in the article. And see what happens.

    BTW I am using FF14 on Win7 64bit

    Seems to work better on the syntax highlighter demo page, the textarea replaces the code block. Dunno what the point is though, the manual seems to be incomplete.

  • (cs)

    Proven fact: if the database doesn't want to process your request, you can trick it by hiding the request among a bunch of other requests.

    In other words, this whole block of code is just a ruse to get the database to do this:

    update tmp set f76 ='p' where f0=1961520010330;
  • (cs) in reply to Carl
    Carl:
    update tmp set f75 ='' where f0=1961720010330;
    Yeah, because it we didn't set it to '' it would have defaulted to, um, what? Blank?
    Shh, it's part of the ruse!
  • (cs) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    TRWTF is not knowing the difference between a database and a spreadsheet. Or PHP.
    Wait, there is a difference?
  • Man in pain (unregistered)

    I invite all interested parties to look at an ExpressionEngine database.

    After you stop screaming, you may take your meds and go back to your life, knowing that you don't have to deal with it.

  • Dulton (unregistered) in reply to Evoex

    Yup, it's a dutch system alright. The postal codes are stored in the dutch "9999 ZZ" format.

  • dogmatic (unregistered) in reply to Some Jerk
    Some Jerk:

    yea... because then if there really is a power failure... all the person updating the form has to do to finish up is remember that the ID is 1961720010330, and know where to put it to prepopulate his old data. How hard can that POSSIBLY be?

    You could easily restore the user's state by reading a cookie or having them login when they return.

  • (cs) in reply to Some Jerk
    Some Jerk:
    Carl:
    update tmp set f75 ='' where f0=1961720010330;
    Yeah, because it we didn't set it to '' it would have defaulted to, um, what? Blank?

    NULL

    FileNotFound, of course

  • (cs) in reply to snoofle
    snoofle:
    ¯\(°_o)/¯ I DUNNO LOL:
    TRWTF is not knowing the difference between a database and a spreadsheet. Or PHP.
    Wait, there is a difference?
    OMG, you didn't go to college, did you? That's where you learn the difference between column names in a database, like f1, f2, etc., and those in spreadsheets: A, B, C. Duh.
  • (cs) in reply to TGV
    TGV:
    OMG, you didn't go to college, did you? That's where you learn the difference between column names in a database, like f1, f2, etc., and those in spreadsheets: A, B, C. Duh.
    You are either joking or totally daft.
  • (cs) in reply to Another
    Another:
    And this, ladies and gentlemen, is why the gods gave us perl.

    sub chokeYourself { my ($secondsToDeath, $numberOfHands) = @_; ... }

    Caller passes extra params? No problem. Update sub to receive $numberOfSpectators, but some callers don't know? No problem again. Just make sure the sub's code gracefully deals with a null $numberOfSpectators.

    Even Visual Basic can do that:

    Function chokeYourself(secondsToDeath As Long, numberOfHands As Byte, Optional numberOfSpectators As Double = 0)
    …
    End Function
  • (cs) in reply to Gurth

    it is vbscript

    optional params myArg

  • the beholder (unregistered) in reply to Some Jerk
    Some Jerk:
    it is vbscript

    optional params myArg

    A tip for you: when whatever is being said in a comment is true, it doesn't need to be corrected.

  • (cs) in reply to Some Jerk

    and I might add that this actually resulted in a lot of silent errors in their app. They had several cases where they did not remember that certain regions of code were calling a method that was modified. At times, the new parameter was relavent information that was supposed to be deposited into a field on their new database (as they moved from foxpro to SQL Server). They didn't get any errors, so they assumed everything was functioning correctly... not realizing all the while that certain billing items were not associated with the client to whom the bill was to be sent.

    There is a good reason to invalidate calls to functions that preceed said modifications... and unflatulantly they learned this lesson too late.

  • (cs) in reply to the beholder
    the beholder:
    A tip for you: when whatever is being said in a comment is true, it doesn't need to be corrected.

    that is... errr... an interesting observation... by some standard :p

  • (cs)

    Now for something a bit off topic...

    Is is just me, or is anyone else getting script exceptions (Java coloring or some such) when the current WTF loads. This just started happening for me a few days ago. It seems to correlate with the code lines displayed. Hitting 'OK' (many times) seems to work around it.

    We now return you to the standard WTF commenting drivel that we all wish we could find "FILE NOT FOUND" in a binary return set. Hi Paula Bean, etc...

  • Silent D (unregistered)

    There must be some NOT NULL constraints that mess up this beautiful design pattern, requiring the INSERT to address three columns at once. That clearly needs to be refactored.

    Could be worse, though, at least the database isn't based on the EAV abomination.

  • (cs)

    The first line suggests that there's always room to add another row, as well as adding another column.

    Looking at the ID...

    cust  tbl order#
    1961  5   20010330  i.e., the address row for the order
    1961  7   20010330  i.e., the shipping address for the order
    1961  8   20010330  i.e., the credit card info for the order
       etc.
    

    Which makes this truly a 2nd order WTF, which is a whole new level of WTF.

    Just think, we cold have rows 1961020010330 thru 196190010330; and then 1961A20010330 thru 1961Z20010330; and then 1961a20010330 thru 1961z20010330; and then rows like 1961!20010330, 1961$20010330, 1961_20010330, and 1961{20010330. We could even have rows containing an 0x07 character in that position.

    Why, we could have lots of rows!

  • dolor (unregistered) in reply to Carl

    [quote user="Carl"][quote]update tmp set f75 ='' where f0=1961720010330;[/quote]Yeah, because it we didn't set it to '' it would have defaulted to, um, what? Blank?[/quote]

    haha - Carl thought for himself, let me say something that everyone will think it's cool, so that I clearly show that I'm mocking the original coder just like they're all obviously doing - even though I have no clue why everyone is laughing, but I will laugh with them so that they don't think I stupid - ok, let me say this [SARCASTICALLY, OUT LOUD]:

    "update tmp set f75 ='' where f0=1961720010330;[/quote]Yeah, because it we didn't set it to '' it would have defaulted to, um, what? Blank?"

    What Carl didn't realize was that he just showed us all how he doesn't understand even the basic SQL syntax or how values are stored in table. It has to be set to something - what? am I supposed to skip it, only because you don't like empty strings, and somehow remember that it's really blank while it's still equal some value, only because you don't like empty strings?

    The NULL guy did try to help Carl understand, but we cannot assume that the field was nullable; so, I still stand behind this: Carl, shut the fuck up, you have a lot to learn.

  • dolor (unregistered) in reply to herby
    herby:
    Now for something a bit off topic...

    Is is just me, or is anyone else getting script exceptions (Java coloring or some such) when the current WTF loads. This just started happening for me a few days ago. It seems to correlate with the code lines displayed. Hitting 'OK' (many times) seems to work around it.

    We now return you to the standard WTF commenting drivel that we all wish we could find "FILE NOT FOUND" in a binary return set. Hi Paula Bean, etc...

    It's just you. IE user? Now, THAT'S a real WTF today.

  • Agention (unregistered) in reply to Another
    Another:
    And this, ladies and gentlemen, is why the gods gave us perl.

    sub chokeYourself { my ($secondsToDeath, $numberOfHands) = @_; ... }

    Caller passes extra params? No problem. Update sub to receive $numberOfSpectators, but some callers don't know? No problem again. Just make sure the sub's code gracefully deals with a null $numberOfSpectators.

    undef, you insensitive clod!

  • Carl (unregistered) in reply to dolor
    dolor:
    ...rant...
    Wow, looks like I got you so pissed that you forgot to use the preview button!
  • (cs) in reply to dolor
    dolor:
    It's just you. IE user? Now, THAT'S a real WTF today.
    that has to be the stupidest thing I have seen on this site (including the wtfs) in a very long time. Whether or not a person uses IE implies absolutely nothing of value, except whether or not they use IE. There are no functional limitations that render an inferior product... no possiblity of brain damage... and no other reason why using IE would cause a specific reaction or judgement toward any comment or artical. You may as well well assume that a specific response was the result of somebody wearing blue wranglers that were a bit too loose around the waist, as to assume that the usage of Internet Explorer has some impact on exactly what text appears beneath their names. Therefore, I must say that the intelligence displayed in producing this posting rivals, at best, that of my 7 year old daughter, who can also type arbitrary responses to specific comments without spelling errors.
  • (cs)

    This isn't a WTF. It's worse.

    It's an EAV, which is a horrible, horrible idea, but it is thoroughly documented horribleness that anyone who has worked with databases for a while has seen.

    I say thoroughly, not well, because the majority of writing on EAV is total waffle-think that will spend twenty thousand words on metadata and clouds without ever touching on what anything is supposed to mean or why the hell you'd want to rewrite your DBMS in the first place.

    Why do people do it? Because just as people try to optimize without knowing what they're optimizing or any proof that they need to, people also try to implement features without knowing what features they need or having any indication that the features are wanted.

    EAV is the ultimate example of that: instead of nailing down the business logic, you just throw your hands in the air and say, "fuck it, let the users make it up as they go along."

  • (cs) in reply to Some Jerk
    Some Jerk:
    dolor:
    It's just you. IE user? Now, THAT'S a real WTF today.
    that has to be the stupidest thing I have seen on this site (including the wtfs) in a very long time. Whether or not a person uses IE implies absolutely nothing of value, except whether or not they use IE. (blah blah waah waah blah blah waah waah)

    You're on a technical site, using a hopelessly broken browser and bitching about how you can't see the site, in spite of the fact that there are free ones available that work.

    PEBCAK.

  • (cs) in reply to dolor
    dolor:
    Carl, shut the fuck up, you have a lot to learn.

    But not from the guy who can't figure out how to post a comment correctly.

  • (cs) in reply to scooby509
    scooby509:
    Some Jerk:
    dolor:
    It's just you. IE user? Now, THAT'S a real WTF today.
    that has to be the stupidest thing I have seen on this site (including the wtfs) in a very long time. Whether or not a person uses IE implies absolutely nothing of value, except whether or not they use IE. (blah blah waah waah blah blah waah waah)

    You're on a technical site, using a hopelessly broken browser and bitching about how you can't see the site, in spite of the fact that there are free ones available that work.

    PEBCAK.

    I use FF, Safari and IE interchangably... just whatever window happens to come up. I suppose that (in your ignorance) you were blissful enough to lay downa comment that had absolutely no substance whatsoever.

    name 1 way that Internet Explorer is either not free or actually broken. Plenty (meaning 2 or 3) people commenting on it... but I PERSONALLY think that you simply dont like that fact that IE is owned by a multi-billion dollar company and is not open source. I have worked on websites (for a living) for 13 years. All I have seen is DIFFERENT behaviors. I haven't seen any proof that lead me to believe that any browser is better than another... in fact... I have always been able to replicate all functionalities in all browsers.

    I suppose this goes to show... if anything works in one browser and not another (at least, recent browser, as all of the main ones are available for free) ... that is a WTF on the MORON who wrote it. you idiots that think one browser is in some way better than another are obviously too lazy or incompetant to learn how to do your jobs, and may as well shut the hell up... because there isn't a damned thing that can be done with one browser and I can't do with every browser used by at least 5% of the population

  • Friedrice the Great (unregistered) in reply to Some Jerk
    Some Jerk:
    scooby509:
    Some Jerk:
    dolor:
    It's just you. IE user? Now, THAT'S a real WTF today.
    that has to be the stupidest thing I have seen on this site (including the wtfs) in a very long time. Whether or not a person uses IE implies absolutely nothing of value, except whether or not they use IE. (blah blah waah waah blah blah waah waah)

    You're on a technical site, using a hopelessly broken browser and bitching about how you can't see the site, in spite of the fact that there are free ones available that work.

    PEBCAK.

    I use FF, Safari and IE interchangably... just whatever window happens to come up. I suppose that (in your ignorance) you were blissful enough to lay downa comment that had absolutely no substance whatsoever.

    name 1 way that Internet Explorer is either not free or actually broken.

    1. You have to buy Windows to get Internet Explorer. Therefore it is not free.

    2. Any version of IE<9 is broken. And at least the version of IE you use seemed to have problems with the site.

    Q.E.D.

Leave a comment on “There's Always Room to Expand”

Log In or post as a guest

Replying to comment #:

« Return to Article