Comment On Slightly OverSQL'd

"A certain coworker of mine likes to do everything in SQL," Christoffer Hoel writes, "and I mean everything." [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Slightly OverSQL'd

2009-11-04 09:01 • by Adam Robinson (unregistered)
select 'FRIST' as FRIST

Re: Slightly OverSQL'd

2009-11-04 09:03 • by Oxin (unregistered)
toletarting?

Re: Slightly OverSQL'd

2009-11-04 09:03 • by blib (unregistered)
I would find the management attitude intoletartable.

Re: Slightly OverSQL'd

2009-11-04 09:09 • by AndrewB (unregistered)
Captcha: toletarting

No way!!

Re: Slightly OverSQL'd

2009-11-04 09:11 • by DOA
Can't wait to see how he validates email addresses.

Re: Slightly OverSQL'd

2009-11-04 09:17 • by Jack (unregistered)

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


Looks like using proper grammer was something he did NOT overdo

Re: Slightly OverSQL'd

2009-11-04 09:19 • by 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.

Re: Slightly OverSQL'd

2009-11-04 09:20 • by Rodnas (unregistered)
OMG. When does the hurting stop?

Re: Slightly OverSQL'd

2009-11-04 09:24 • by Roxanne (unregistered)
289799 in reply to 289790
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.

Re: Slightly OverSQL'd

2009-11-04 09:24 • by Nice try (unregistered)
289800 in reply to 289795
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

Re: Slightly OverSQL'd

2009-11-04 09:24 • by Ouch! (unregistered)
289801 in reply to 289795
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.

Re: Slightly OverSQL'd

2009-11-04 09:31 • by tim (unregistered)
289802 in reply to 289800
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

Re: Slightly OverSQL'd

2009-11-04 09:32 • by My Name? (unregistered)
289804 in reply to 289796
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'.

Re: Slightly OverSQL'd

2009-11-04 09:36 • by anon (unregistered)
289805 in reply to 289790
Oxin:
toletarting?
Seriously, how can you even type that?

Re: Slightly OverSQL'd

2009-11-04 09:37 • by highphilosopher (unregistered)
289806 in reply to 289799
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???

Re: Slightly OverSQL'd

2009-11-04 09:38 • by Swa (unregistered)
289807 in reply to 289804
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.

Re: Slightly OverSQL'd

2009-11-04 09:41 • by stimmell
Sadly, I am all too familiar with applications that use SQL to do string parsing, complex mathematics, etc.

Re: Slightly OverSQL'd

2009-11-04 09:44 • by VeryProfessional (unregistered)
If you have a hammer, everything looks like a nail...

Re: Slightly OverSQL'd

2009-11-04 09:44 • by Scott M (unregistered)
At least he used parameters instead of concatenating it

Re: Slightly OverSQL'd

2009-11-04 09:46 • by 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?

Re: Slightly OverSQL'd

2009-11-04 09:48 • by A Nonny Mouse
289812 in reply to 289809
VeryProfessional:
If you have a hammer, everything looks like a nail...

i think you mean hammar (when in rome..)

Re: Slightly OverSQL'd

2009-11-04 09:48 • by 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.

Re: Slightly OverSQL'd

2009-11-04 09:50 • by Nanitous (unregistered)
Why? Without any sarcasm I'ld be very interested in his/her motivation.

Re: Slightly OverSQL'd

2009-11-04 09:51 • by Jim (unregistered)
289815 in reply to 289797
Don't worry it won't even IF(DATE(?) <= DATE(?)

Re: Slightly OverSQL'd

2009-11-04 10:01 • by 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");
}

Re: Slightly OverSQL'd

2009-11-04 10:03 • by dkf
289817 in reply to 289812
A Nonny Mouse:
i think you mean hammar (when in rome..)
Ah, but Hamar is in Norway, not Italy...

Re: Slightly OverSQL'd

2009-11-04 10:04 • by SenTree
289819 in reply to 289802
tim:
throw new TooManyLayersOfPedantryException 

..........................................^
Error at line 1 col 43: ";" expected
FTFY

Re: Slightly OverSQL'd

2009-11-04 10:04 • by lolwtf
289820 in reply to 289811
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.

Re: Slightly OverSQL'd

2009-11-04 10:07 • by Brian (unregistered)
289821 in reply to 289811
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.

Re: Slightly OverSQL'd

2009-11-04 10:12 • by Anonymous Coeliac (unregistered)
intoletartarance- adverse reaction to the gluten contained in dessert pastries.

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

Re: Slightly OverSQL'd

2009-11-04 10:18 • by 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.

Re: Slightly OverSQL'd

2009-11-04 10:20 • by methinks (unregistered)
289824 in reply to 289795
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))

Re: Slightly OverSQL'd

2009-11-04 10:20 • by Peter (unregistered)
289825 in reply to 289821
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).

Re: Slightly OverSQL'd

2009-11-04 10:22 • by hikari
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.

Re: Slightly OverSQL'd

2009-11-04 10:24 • by methinks (unregistered)
289828 in reply to 289819
SenTree:
tim:
throw new TooManyLayersOfPedantryException 

..........................................^
Error at line 1 col 43: ";" expected
FTFY


No.
Error at line 1 col 43: "(" expected

Re: Slightly OverSQL'd

2009-11-04 10:26 • by My Name? (unregistered)
289829 in reply to 289811
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

Re: Slightly OverSQL'd

2009-11-04 10:27 • by RBoy (unregistered)
Termination date is way too late.

Re: Slightly OverSQL'd

2009-11-04 10:29 • by 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.

Re: Slightly OverSQL'd

2009-11-04 10:36 • by JohannesH (unregistered)
I can relate

Re: Slightly OverSQL'd

2009-11-04 10:37 • by SQL Guy (unregistered)
Awful, just awful!

He didn't even use a stored procedure!

Re: Slightly OverSQL'd

2009-11-04 10:40 • by tdittmar
289834 in reply to 289819
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...

Re: Slightly OverSQL'd

2009-11-04 10:41 • by SR (unregistered)
289835 in reply to 289833
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.

Re: Slightly OverSQL'd

2009-11-04 10:42 • by Manager who uses too much time developing instead of managing (unregistered)
289836 in reply to 289809
VeryProfessional:
If you have a hammer, everything looks like a nail...


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

Re: Slightly OverSQL'd

2009-11-04 10:42 • by SR (unregistered)
289837 in reply to 289834
tdittmar:
Then I started to wonder how you can have more than one layer of pee...


Many layers of yellow snow?

Re: Slightly OverSQL'd

2009-11-04 10:50 • by Laws Murphy (unregistered)
289838 in reply to 289817
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!

Re: Slightly OverSQL'd

2009-11-04 11:05 • by Foo (unregistered)
289839 in reply to 289838
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

Re: Slightly OverSQL'd

2009-11-04 11:19 • by k (unregistered)

throw new Exception("#ff0000");

FTFY.

Re: Slightly OverSQL'd

2009-11-04 11:43 • by anonymous (unregistered)
289842 in reply to 289816
why! for the love of god why!

Re: Slightly OverSQL'd

2009-11-04 12:06 • by rulez (unregistered)
289844 in reply to 289795

if(!allowed.equalsIgnoreCase("allowed")){


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

Re: Slightly OverSQL'd

2009-11-04 12:12 • by adiener (unregistered)
289847 in reply to 289816
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.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment