- 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
Admin
"I'm still trying to figure out how truth can fail."
Watched any of the popular 24/7 news channels lately?
Admin
You can't handle the truth!
Admin
Admin
Admin
No problem! The code is enterprisey enough so that every method in it catches all and logs the exception. It just needs to find the logger of the alternate universe (which is really the same universe with a different logic)
Admin
At first glimpes, it's a small WTF - if at all. On further reflection, this function seems to have been deprecated and its functionality removed. And, instead of spending the time going through the entire code base and refactoring every spot that touched this function, they simply made it a stub that always returns true; probably with the idea of coming back at a later date to remove the function and its references completely. Should they have removed the Try/Catch? Maybe, but it's a no-op, so it does no harm except to waste a few bytes on the disk (and somehow qualify as a front-page WTF on this site).
Admin
I hope Brenden Sharp's VB is better than his English.
Admin
I agree and disagree. I like functions that are populating objects to return a bool. However, I want my results as well. This is a pretty popular concept in C#, and it's how all 'Try' methods (TryParseInt, for example) are implemented.
I like this because it's encapsulated. It's easily testable, and all the mess is "hidden". Calling your method is beautiful.
Now, if your method isn't actually doing anything that returns results, like sending a bunch of e-mails. I think simply returning a bool is perfect. What results do you want? A count? A list of recipients? I have no idea. Most people just care that it worked.
Admin
Put it in a "while true" loop of course, and keep going round and round until it works. Don't forget to write the stack dump of why it didn't work to a log file, preferably on another machine, the one hosting the production database would be best. Then every evening at about 6:30 you get the line printers to print the file out.
Admin
Hm, yes and an intern to read and type them back in to find the error.
Admin
Also just to clarify, what you would need to do if you would actually ever WANT to do this, is to modify your method signature to pass in your object using the ref keyword, otherwise your object will still be null after the method call.
I dunno, there are several big WTFs here and I'm beginning to think I just got trolled...
Admin
Exceptions are for exceptional circumstances...things that can not reasonably be predicted. If "no rows" (to use your example) is a valid business condition then it should not throw.
Want to have some fun, work on a project (common in many industries, including financial) whhere any exception thrown (even if caught) causes the NOC to contact the on-call support person to immediately adress the issue. Specific exceptions (i.e. arguments, call stack, context) that have been previously deems "acceptable" ae stored in a DB which is checked before the alert procedure.
You learn very quickly to make sure that the things that trigger exceptions are really exceptional.
Admin
I had a retarded co-worker who would have an issue with that plan.
Admin
Clealy, what is needed is a subroutine to encapsulate the process of calling EmailList(), and then it can just be wrapped in a single try-catch block there.
Admin
The fact that it can be historically explained doesn't mean it's not a WTF (if I wanted to troll, I'd make a reference to imperial units here). So, it impacts code readability doesn't it? That's enough for me. It's not a rocket-destroying WTF, but we can't afford one of those everyday.
Admin
Admin
Admin
Admin
LMFTFY:
Admin
Fuck off, Bob.
Admin
Admin
Admin
I'm starting to think some guy with too much time on his hands (that does not narrow down the choice here) coded a bot which regularly scans comments and posts this shit.
Let's have a try now: retard, the world is retard it's no trick of the screen it's hard on the mind retard, the world is retard dumb to the sight and hard on the mind in the gray of the interwebs
Admin
Admin
Admin
Aha! Easy-peasy. What you do is to make the exceptions poisonous!
And you probably meant "is punishable by death".
Admin
Admin
Admin
Akismet, this is a perfectly legitimate comment. I don't appreciate you calling me spam!
Akismet, how many times do I have to do this? We can't use links? Why the fuck not!?!
Okay, I removed the porn link - happy now?
Admin
In case you can’t tell, this is a grown-up place. The fact that you insist on using your sensitivity clearly shows that you’re too young and too stupid to be using thedailywtf.com.
Go away and grow up.
Sincerely, Bert Glanstron
Admin
Otherwise he'd have said "Swallowing of exceptions is punishable by death."
Admin
And simple repetitive recycling of a tired and boring memelet shows you to be a retard. Hence, I use the word "retard". Or, if you prefer, I'll call you a moron. Or would "tedious dipshit" suit you better? Take your pick. I know I'll see you posting "I had a son who was a tedious dipshit, and I can assure you..." soon enough, in any case, because you're a tedious dipshit. And a moron. And, oh, right, a retard.
In sum, (let's say it all together, now) fuck off, Bob.
Admin
Admin
And even though I just though of what "dipshit" could be an amusing euphemism for, I'm not going with it because Bob already sucked all the fun out of the room.
FACE!!! as in IN YOURS! as in I CAME!
Admin
O Hai guys! is there anything I can do to stir the pot a little more?
Admin
Admin
Admin
This is exactly what I think every time we see this type on non-WTFy WTF...
Admin
Admin
You're brillant, because I was going to post this same thing and had the foresight to look for it first.
(Yours is much better than what I was going to write.)
Admin
You can't handle the truth!
Admin
Admin
Admin
Yeah you just suck
Admin
Admin
I was going to insult you, but it seems being you is enough of an insult.
Admin
Admin
Admin