• Adam Robinson (unregistered)

    select 'FRIST' as FRIST

  • Oxin (unregistered)

    toletarting?

  • blib (unregistered)

    I would find the management attitude intoletartable.

  • AndrewB (unregistered)

    Captcha: toletarting

    No way!!

  • (cs)

    Can't wait to see how he validates email addresses.

  • Jack (unregistered)
    if(!allowed.equalsIgnoreCase("allowed")){ throw new Exception("Termination Date to early!"); }

    Looks like using proper grammer was something he did NOT overdo

  • Zer0 (unregistered)

    How in the world would this run the same as real code? Maybe they just don't care about performance.

    Uh oh... the database server is down, can't do any more date/time functions.

  • Rodnas (unregistered)

    OMG. When does the hurting stop?

  • Roxanne (unregistered) in reply to Oxin
    Oxin:
    toletarting?

    Yeah, that's an alternate spelling of "tarting up". As in, "tarting up the code". Putting on red lipstick and dark eye makeup, spraying on gallons of cheap perfume, squeezing into a tight skimpy outfit.

    Apparently, tarted up code is very popular with management.

  • Nice try (unregistered) in reply to Jack
    Jack:
    if(!allowed.equalsIgnoreCase("allowed")){ throw new Exception("Termination Date to early!"); }

    Looks like using proper grammer was something he did NOT overdo

    What's grammer? Is it anything like grammar?

    throw new TooManyLayersOfPedantryException

  • Ouch! (unregistered) in reply to Jack
    Jack:
    if(!allowed.equalsIgnoreCase("allowed")){ throw new Exception("Termination Date to early!"); }

    Looks like using proper grammer was something he did NOT overdo

    To pick a nit: It's a matter of spelling, not grammar. And you've slipped in a typo, too.

  • tim (unregistered) in reply to Nice try
    Nice try:
    Jack:
    if(!allowed.equalsIgnoreCase("allowed")){ throw new Exception("Termination Date to early!"); }

    Looks like using proper grammer was something he did NOT overdo

    What's grammer? Is it anything like grammar?

    throw new TooManyLayersOfPedantryException

    throw new TooManyLayersOfPedantryException ..........................................^

    Error at line 1 col 43: ";" expected

  • My Name? (unregistered) in reply to Zer0
    Zer0:
    How in the world would this run the same as real code? Maybe they just don't care about performance.

    Uh oh... the database server is down, can't do any more date/time functions.

    You obviously have not yet seen their 'real-code'.

  • anon (unregistered) in reply to Oxin
    Oxin:
    toletarting?
    Seriously, how can you even type that?
  • highphilosopher (unregistered) in reply to Roxanne
    Roxanne:
    Oxin:
    toletarting?

    Yeah, that's an alternate spelling of "tarting up". As in, "tarting up the code". Putting on red lipstick and dark eye makeup, spraying on gallons of cheap perfume, squeezing into a tight skimpy outfit.

    Apparently, tarted up code is very popular with management.

    So you're saying (to quote a previous day's commenter)...

    Management likes their code the way they like their women... 12 years old, undocumented, and apparently tarted up???

  • Swa (unregistered) in reply to My Name?
    Zer0:
    How in the world would this run the same as real code? Maybe they just don't care about performance.

    Uh oh... the database server is down, can't do any more date/time functions.

    maybe their business logic or UI layer is so fucking bloated that the additional latency of throwing this snippet at a SQL server can be neglected?

    this, of course, will only be valid until the SQL server runs into performance issues.

    as for you database down comment? chances are you can't do jack shit in their app if the database is down anyway.

    Captcha: vereor: truer than the truth.

  • (cs)

    Sadly, I am all too familiar with applications that use SQL to do string parsing, complex mathematics, etc.

  • VeryProfessional (unregistered)

    If you have a hammer, everything looks like a nail...

  • Scott M (unregistered)

    At least he used parameters instead of concatenating it

  • Zapp Brannigan (unregistered)

    Note: I submit all of my comments with grammar and spell check options disabled.

    Is it a form of recursion when someone points out a grammar or spelling error in a post when their replying post also has a spelling or grammar error?

  • (cs) in reply to VeryProfessional
    VeryProfessional:
    If you have a hammer, everything looks like a nail...
    i think you mean hammar (when in rome..)
  • CesarMaia (unregistered)

    C'mon... you made that up. Or maybe this guy is an abstract/surreal artist who likes to add "flavor" to his code.

    But I think you made that up. Its too bizarre, even for TheDailyWTF.

  • Nanitous (unregistered)

    Why? Without any sarcasm I'ld be very interested in his/her motivation.

  • Jim (unregistered) in reply to Rodnas

    Don't worry it won't even IF(DATE(?) <= DATE(?)

  • (cs)

    bool FirstIsLowerOrEqual (int i1, int i2) { std::string test = "if [ $i1 -le $i2 ]; then echo first; else echo second; fi"; std::ostringstream cmd; cmd << "i1=" << i1 << "; i2=" << i2 << ";" + test; return ! system ("test ssh some.where /bin/sh -c '" + cmd.str() + " == first"); }

  • (cs) in reply to A Nonny Mouse
    A Nonny Mouse:
    i think you mean hammar (when in rome..)
    Ah, but Hamar is in Norway, not Italy...
  • (cs) in reply to tim
    tim:
    throw new TooManyLayersOfPedantryException 
    ..........................................^
    Error at line 1 col 43: ";" expected
    FTFY
  • (cs) in reply to Zapp Brannigan
    Zapp Brannigan:
    Note: I submit all of my comments with grammar and spell check options disabled.

    Is it a form of recursion when someone points out a grammar or spelling error in a post when their replying post also has a spelling or grammar error?

    Muphry's Law.

  • Brian (unregistered) in reply to Zapp Brannigan
    Zapp Brannigan:
    Note: I submit all of my comments with grammar and spell check options disabled.

    Is it a form of recursion when someone points out a grammar or spelling error in a post when their replying post also has a spelling or grammar error?

    I don't know. You tell me. Someone is singular, thus the pronoun referring to someone should be singular as well, such as his, her, or his/her.

  • Anonymous Coeliac (unregistered)

    intoletartarance- adverse reaction to the gluten contained in dessert pastries.

    No, I didn't have anything to add to TFWTF.

  • Anonymous (unregistered)

    Awesome, I might use this pattern to farm out all our mathematical routines to the database. Databases do maths, don't they?

    PS. Not a word about "maths", OK? I'm English, you're American, get over it already.

  • methinks (unregistered) in reply to Jack
    Jack:
    if(!allowed.equalsIgnoreCase("allowed")){ throw new Exception("Termination Date to early!"); }

    Looks like using proper grammer was something he did NOT overdo

    "grammEr"?

    Well well well, if this is not a classic (or rather clbuttic) case of Muphry's Law ( http://en.wikipedia.org/wiki/Muphry's_law ) (do not confuse with Murphy's Law!)

    ;oP

    With regards to content, however, you are correct - dude can't spell "too" or can't tell the difference between "to" and "too"... What he needed, was a proper crammer (what you probably meant in the first place ;o))

  • Peter (unregistered) in reply to Brian
    Brian:
    Zapp Brannigan:
    Note: I submit all of my comments with grammar and spell check options disabled.

    Is it a form of recursion when someone points out a grammar or spelling error in a post when their replying post also has a spelling or grammar error?

    I don't know. You tell me. Someone is singular, thus the pronoun referring to someone should be singular as well, such as his, her, or his/her.
    Or you can use the widely-accepted (albeit sometimes deprecated) convention of using "their" as a neuter singular adjective or determiner (not pronoun).

  • (cs)

    I wish I could say I hadn't seen that kind of code before, unfortunately I can't; I have found many examples of it in code written by my predecessor. Usually he wanted to compare two dates; as far as I can tell it never occurred to him that .NET might be able to handle that itself perfectly well.

  • methinks (unregistered) in reply to SenTree
    SenTree:
    tim:
    throw new TooManyLayersOfPedantryException 
    ..........................................^
    Error at line 1 col 43: ";" expected
    FTFY

    No.

    Error at line 1 col 43: "(" expected
  • My Name? (unregistered) in reply to Zapp Brannigan
    Zapp Brannigan:
    Note: I submit all of my comments with grammar and spell check options disabled.

    Is it a form of recursion when someone points out a grammar or spelling error in a post when their replying post also has a spelling or grammar error?

    Error: You haved commented off topick!

    SCNR

  • RBoy (unregistered)

    Termination date is way too late.

  • Jasper (unregistered)

    At least he knows how to use PreparedStatement!

    It would have been even more hilarious if this piece of code would be written by concatenating pieces of SQL, making it potentially vulnerable to SQL injection attacks.

  • JohannesH (unregistered)

    I can relate

  • SQL Guy (unregistered)

    Awful, just awful!

    He didn't even use a stored procedure!

  • (cs) in reply to SenTree
    SenTree:
    tim:
    throw new TooManyLayersOfPedantryException 
    ..........................................^
    Error at line 1 col 43: ";" expected
    
    FTFY

    Actually I had a good laugh at the first version, as it was formatted like

    throw new TooManyLayersOfPedantryException 
    ..........................^
    Error at line 1 col 43: ";" expected
    

    Then I started to wonder how you can have more than one layer of pee...

  • SR (unregistered) in reply to SQL Guy
    SQL Guy:
    Awful, just awful!

    He didn't even use a stored procedure!

    Stored procedures are not the answer.

    Stored procedures are the question. The answer is "No".

    Please ignore any grammer errors in this commentent.

  • Manager who uses too much time developing instead of managing (unregistered) in reply to VeryProfessional
    VeryProfessional:
    If you have a hammer, everything looks like a nail...

    When you got a hammer, everything is a nail my friend.

  • SR (unregistered) in reply to tdittmar
    tdittmar:
    Then I started to wonder how you can have more than one layer of pee...

    Many layers of yellow snow?

  • Laws Murphy (unregistered) in reply to dkf
    dkf:
    A Nonny Mouse:
    i think you mean hammar (when in rome..)
    Ah, but Hamar is in Norway, not Italy...
    Only if he hasn't gone a Viking!
  • Foo (unregistered) in reply to Laws Murphy
    Laws Murphy:
    dkf:
    A Nonny Mouse:
    i think you mean hammar (when in rome..)
    Ah, but Hamar is in Norway, not Italy...
    Only if he hasn't gone a Viking!

    sounds like fun.. i could use some good village pillaging to improve my mood

  • k (unregistered)
    throw new Exception("#ff0000");
    

    FTFY.

  • anonymous (unregistered) in reply to Federico

    why! for the love of god why!

  • rulez (unregistered) in reply to Jack
    if(!allowed.equalsIgnoreCase("allowed")){

    Apparently this implementation was a trade-off towards his Nazi Java colleagues.

  • adiener (unregistered) in reply to Federico
    bool FirstIsLowerOrEqual (int i1, int i2) { std::string test = "if [ $i1 -le $i2 ]; then echo first; else echo second; fi"; std::ostringstream cmd; cmd << "i1=" << i1 << "; i2=" << i2 << ";" + test; return ! system ("test `ssh some.where /bin/sh -c '" + cmd.str() + "` == first"); }
    Nice, but you have an unterminated single quote in there.

Leave a comment on “Slightly OverSQL'd”

Log In or post as a guest

Replying to comment #:

« Return to Article