- 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
Hey, let's be honest. The code does one thing right:
It uses "throw" instead of "throw ex". The latter is what I'm fighting here, because most of the time it does NOT what the programmer intended.
So.. 1 point for understanding rethrowing, -10 for useless crap?
Admin
Admin
I concur. I figured maybe they were having some database connection issues and left it in so they could easily debug it later (or, as you suggest, as a reminder to get back to it later).
It's not good, but it's not in the evil category
Admin
My boss does that all the time. Drives me nuts.
Admin
D'OH - I meant to quote the part about catching "Exception" and just ignoring it. Sorry guys. heads for coffee machine
Admin
Admin
Sorry, but I don't buy that. An IDE that has "throw" as template code for a catch block is crap^Wmisconfigured. The default for VS would be (afaik) a comment or nothing at all, not a "throw".
Admin
No. Try not. Do... or do not. There is no try.
Admin
Admin
It's Supper Effective! Maintenance Programmer Faints!
Admin
Catch ex As BrillantPaulaBeanException Throw Catch ex As GeneralException Throw Catch ex As CAPTCHAException Throw Catch ex As BobXException XBobThrow Catch ex As MandatoryFunDay Paint
Admin
Smalltalk and Lisp already had the option to resume execution at the point an exception was thrown: http://www.cincomsmalltalk.com/blog/blogView?entry=3321788777&showComments=true
Admin
Admin
Not only are those exceptions not in alphabetical order, but they don't cover all possible exceptions that can be thrown by the two method calls in that line of code.
http://msdn.microsoft.com/en-us/library/d133hta4.aspx
http://msdn.microsoft.com/en-us/library/a87che9d.aspx
Admin
Admin
So, VB is bad because it is not like C, but it is also bad for having a feature that makes it more like C.
Admin
I applaud you for your honesty and ability to fit in.
Admin
I finally got a WTF! And no - it's not some boiler plate code that can't be modified without upsetting the original code generator. I've seen the monkeys with my own eyes type up this sort of code and implement this bastardized factory/dao pattern over and over. When I first started, I suggested they use a simple object-relational mapper I had previously developed to automate some of the tedium, and everyone got really excited. Unfortunately, it didn't work because it depended on SQL Server metadata to detect foreign keys, and the DBAs had inexplicably outlawed foreign keys on ALL TABLES.
Here's another snippet from the same file:
Imports System.Exception Imports System.ApplicationException
I could zip up the entire application as one big WTF. They secured the administration portion by hiding the admin links on the main page, but there's nothing stopping someone from just typing the admin url directly.
Admin
The old "joke" about XML really isn't funny any more.
FileNotFound is wearing thin.
Admin
But on an embedded system with no room for a filesystem, FileNotFound is the only joke we have left!
(This marks my first and hopefully last TDWTF meme joke).
Admin
Professionals handle the exception in a smooth way:
Admin
Guess try { //blah blah } catch (Throwable t) { //meh meh } could've helped but I'm not sure if V$ supports 'Throwable' :D
Admin
Admin
Don't u people ever get tired of these old jokes?
Admin
The Diaper anti-pattern is actually encouraged by .NET, while Java forces you to handle your Exceptions, .NET doesn't. So when you end up having shit crawl up to the main program, you can't really know which Exceptions are being thrown, as the methods don't have a throws clause. This makes it so that the only way to guarantee catching the Exception is ... well... catching Exception.
At least with Java, you know what kind of Exceptions you're going to get.
Admin
A slight misinterpretation of static code analysis warning CA1031: Thou shalt not catch general exception types?
Admin
Got to catchem all Exceptionemon! hahaha This is ridiculous hahaha This is the most useless code statements - dont they realize that if there is an exception it will be thrown anyway?? hahahaha
Admin