- 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
Most languages that I know of would complain loudly at the empty try block, so! Who wants to bet this project had over 1000 warnings? (also, obligatory "Simpsons did it")
Admin
Wondering if there's any real reason
base.OnLoad(e)
couldn't betry
ed.tri
ed?Admin
I would like to try the frist nothing.
Admin
Expanding on Remy's assumption as to how this code came to be, it could be another
butt
enine rule. "If a function must call a function from the class it overloads, then the call must be the first thing that happens in the function."Admin
on my project cc -Wall >warning.log gives over 2 mb file
Admin
Do. Or do not. There is no try - Yoda
Admin
The word is "asinine" if you were trying for a seriously-past-its-sell-by-date joke.
Admin
Yeah, an old one indeed. https://thedailywtf.com/articles/29-Just-Say-It
Admin
Someone is thinking this is a constructor, where the first statement must be the call to the parent's constructor, if you are going to use one at all, at least in .Net languages, like C# or VB.Net.
Admin
No comments. No unicorns. No rainbows. Remy, have you been hacked?
Admin
No easy reader version? Literally unreadable.
Admin
On my project, the build fails if either cppcheck or gcc -Wall -Wextra -pedantic finds anything. I still want to add the clang analyzer wrapper 'scan-build' to the process.
Admin
I'm still impressed by how much WTF is in the unreachable logging line. What all is going on under the hood for LoggingService? No, there were some things man was not meant to know...
Admin
No what drove them under was having their tabs set to 8 characters! :-O
Admin
There is nothing. Remy didn't even try.
Admin
I have a much more mundane explanation for this - it's a blank template. When they make a new class, they use some sort of template that comes along with a basic skeleton like this. If there was something useful to do, then the person writing that code wouldn't forget the try/cath/log part. If there isn't anything... well, someone forgot or just didn't bother to clean up.
Admin
My associated assistant assured me that no-such assinine class rule has been assembled.
Admin
The actual problem is that base.OnLoad(e) sometimes threw some exception, and the author of the derived class used to wonder why his code failed to catch it...
Admin
Then TRWTF would be the template logging unhandled exceptions in the OnLoad event instead of implementing it somewhere more global. And even worse - that it swallows the exception rather than re-throwing it.
Admin
True dat.
Admin
Are we not going to discuss the string.Format("")?
Admin
Nope, not a blank template. I dug deep in the version history (which presumably is a dump of an svn resulting in one folder per minor version)... The OnLoad was added like that long after the class existed.
Admin
TRWTF is the anonymization:
Apparently the editor doesn't even know that a more specific class is usually extending a more generic one but at the same time feels entitled to complain about other peoples code...