- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I want to make a comment, but I got nothing.
Admin
select '' [comment]
Admin
I can see the point of this. Who knows when you might need to change the type of Nothing system-wide.
Admin
Once a great philosopher said:
You know, you come from nothing, you're going back to nothing. What have you lost? Nothing!
Admin
My eyes, the goggles do nothing!
Admin
Admin
This is what they call "having something for Nothing"!
Admin
Love it! Must be the database connection of the Nada software. :)
Admin
TRWTF is that in oracle, '' is actually equivalent to null.
Admin
What's worse, if this is MS SQL Server, the engine treats that as a system stored proc and may spend additional time doing a lookup for it. So not only does it do nothing, it wastes even more CPU cycles than one might think.
captcha: ideo: It's not quite an idea, but sort of a bad thought.
Admin
You get nothing for nothing, if that's what you do...
Admin
Soft coding the value of nothing is obviously to aid future maintenance. 'Nothing' is an entirely subjective quantity depending on your field of expertise (I'm looking at you, quantum physicists).
Admin
I get scared that this might be a whitespace program.
Admin
"Money for nothing and chicks for free", i think the old coder had it figured out.
Admin
They probably had a meeting at some point at which the developer said "Nothing could possibly solve this problem!"
Admin
Then the real WTF is there are no comments.
CREATE PROCEDURE [sp_getNothing] AS
select '' as Nothing -- Bring on the chicks END
Admin
TRWFT is the lack of sp_setNothing
Admin
More stored procedures you call the cooler you are. Ok?
Admin
Sure, just don't ever work on my team. OK?
Admin
Obviously some overzealous senior architect required that all data access routines use stored procedures-- even when the result is "return null".
Admin
I would love to see a code snippet where this procedure gets called
Admin
Nah, I think that would have to be a different SP, something like this:
CREATE PROCEDURE sp_Dire AS select cast('' as money) as nothing,'' as chicks END
Admin
Admin
Oops; didn't read the "spec" properly. Should be
CREATE PROCEDURE sp_Nothing AS select cast('' as money) as nothing,'chicks' as free END
Admin
Eric Idle?
Admin
Admin
System.out.println("Hello World!");
Actually, scrub that.
System.out.println("");
Fixed.
Admin
Ah, yes, I see the problem. It should have been implemented as a UDF instead of a Stored Procedure; the way it's done now, the result has to be selected into a temporary table. A UDF version could be used with SELECT and WHERE statements for queries that depend heavily on nothing.
Admin
You'll get nothing and like it!
Admin
"The only true wisdom consists in knowing that you know nothing"
"Dear subconscious this is an important message, give me all your monies and chicks"
""
Admin
Where can I get some damn bait?
Admin
This is the result of getting paid per line of code. He got money for Nothing.
Admin
"You get NOTHING! You lose! Good day, sir." Gene Wilder as Willie Wonka.
Admin
Clearly this is a placeholder for where features would potentially be added later or where it had been removed but the surviving code still needed an answer.
Admin
This stored proc solves a problem I've had for the past 7 months! TY TDWTF!
Admin
Not completely true.
In 2008 the user database is searched before master is so there is no performance penalty by using an "sp" prefix ... although, in my opinion, it's good practice not to.
Cheers!
Admin
Admin
Where's the WTF?
How?
Admin
Don't you mean
Admin
It was an app to support a CEO's staff meeting? Seems like this would be a function that would be used often...
Admin
Admin
Possible usage of sp_getNothing:
parameters.Add("UserID", UserID);
switch(whatToGet){ case GetThis.UserID: spname="sp_getNothing"; break; case GetThis.Name: spname="sp_getName"; break; case GetThis.DOB: spname="sp_getDOB"; break; case GetThis.FileID: spname="sp_getFileID"; break; default: spname="sp_getNothing"; break; }
comm.CommandText=spname;
etc...
This is still bad practice.
Admin
Admin
There's nothing good unless you do it yourself.
Admin
So, the programmer that wrote this got paid for doing nothing.
Or that he was good for nothing.
I'm not sure, but sp_getNothing facillisis both situations.
Admin
You wouldn't happen to have identified that this is the way Oracle works by using SAS SQL/Connect would you?
Admin
what does that do, and how do I run it? I'm feeling dangerous...
Admin
Hey, this is fun.
Admin
ditto
Admin
ditto