- 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 think it is impossible for "Return True" to create an error.
I mean the function even returns Boolean. If you prefer to create solid robust code then i suggest you study more or something.
Your comment is a WTF to me.
Admin
Another WTF is that this topic has the word robust spelled as robost in some of the replies here. [:P]
I guess someone made a spelling error and decided to correct it. Too bad you forgot a few places, Alex... [:S]
Admin
I think it is impossible for "Return True" to create an error.
I mean the function even returns Boolean. If you prefer to create solid robust code then i suggest you study more or something.
Your comment is a WTF to me.
Admin
I think it is impossible for "Return True" to create an error.
I mean the function even returns Boolean. If you prefer to create solid robust code then i suggest you study more or something.
Your comment is a W.T.F to me.
Admin
Andrew, posting your message over and over again is another WTF... [:$]
Admin
There is, actually, a way an exception could occur in that line. This would however not come from the actual 'return true' line, but this would be an asynchronous exception triggered from the outside, for instance a ThreadAbortException (actually that's the only one I can think of, but still).
This still wouldn't be good code though... if just because you should never ever catch Exception. For instance when a ThreadAbortException occurs they will catch it, and turn it into a different kind of exception, causing the thread not to abort. If that was their intention, which I sincerely doubt, they should've made that explicit by handling ThreadAbortException.
Admin
This code doesn't seem overly strange to me. The previous two companies I worked for had strict coding standards that HAD to be followed at all costs. Sure, it meant writing a ton of useless code, but it also helped to enforce certain practices and helped the companies maintain their ISO9001 certification. All functions we wrote were generated using pre-defined templates that filled in error handling. Anything that didn't contain the company-mandated error handling (or a ridiculously large, 30+ line comment header) would result in your being hauled in front of the management team to explain why before being made to fix the code.
Looking at this code, it smells of similar auto-generation. It looks as if VB6 templates were ported into VB.NET without much real thought. One company I worked for had VB6 templates written by a C programmer who had no understanding of VB, unfortunately he was a director in the company so we had to follow his standards. This meant we had some seriously wonky error-handling code, but if you wanted to keep your job, you wrote the code they wanted.
Without seeing any other code in the same project we will never know for sure, but I wouldn't be surprised to see the same error handling throughout.
The real WTF is that the function only returns true. Maybe as some have suggested this is either a stub, or the real check has been made redundant but the function is left in because it is being called from several other places?
Admin
You're from the Netherlands! How can you correct us on such things?
(Actually, I'm just jealous of your intellect...but that's besides the point!)
[8o|] Arrrggghhh! [8o|]
Admin
Hard to catch a joke when it's all written by Anonymous.
Error catching and joke catching... hmmm [^o)]. Must work the same way for this WTF. This try catch is practically a joke.
I wonder if the code would look like this...
Admin
Is the sole purpose of the function to return True? Must be generating so much heat in the CPU that it goes unstable and throws random exceptions, thus the pre-cautionary steps.
Admin
I agree, Andrew: How can the anonymous man* trust the error handling keywords to work? If you can't trust Return True, who can you trust?
But not the Anonymous Man: He is not anonymous but pseudonymous.