| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |
|
E is for Exception and that's good enough for me. OM NOM NOM!
|
|
I hate those pesky e's. I had to get rid of them all over my codebase too. It didn't do much for the application, but it builds a little faster now....
|
|
this is still dangerous code. To make it truly safe it needs a
finally {}
|
+10. That's awesome! |
|
All this talk about "e" is going to attract all of those discotheque-crazy Europeans from yesterday's comment thread.
|
|
It's the Bad Code Offsets you and your team buy each month that keep the Apache project running isn't it?
|
|
How about an extension method to teach these people what to do with exceptions? I use ex.Log(), which uses a static, configurable ErrorLog class to log the full stack trace and everything else to the EventLog, and emails the same to the developer.
|
I never knew you could combine that with catch {}. I guess you unlearn something new every day. |
|
What language is this? This wouldn't even compile in Java without the 'e'.
|
|
Oh, how I wish this story was fake... We were asked to do the same in our codebase; to remove all compilation warnings without changing behavior.
There is seemingly a market for software that behaves like a pack of rabid werewolves. |
|
DoProcessReceipts() just looks like a long-ass 100+ line function that does SQL queries, array manipulation, and a ton of other operations that can be prone to all kinds of exceptions. I can't believe there isn't even a log entry for when something goes wrong.
|
You know, it's sometimes hard to tell around here when someone is pulling your leg in the comments. So I think I'll just sit back and let this sail on by ... |
It's C#, the 'joke' is that with the e you get a warning 'Variable e is declared but never used', so they removed it. |
|
Fixed?
|
|
This is standard programming practice in Hyderabad
|
FTFY |
Re: The Pesky "e"
2011-07-06 11:32
•
by
Britmaster
(unregistered)
|
You mean American Trolls masquerading as Europeans, right? Everyone in Europe is on Summer vacation for 3 months. TRWTF is American labour laws. |
Re: The Pesky "e"
2011-07-06 11:34
•
by
zunesis
(unregistered)
|
Even better |
Re: The Pesky "e"
2011-07-06 11:35
•
by
zunesis
(unregistered)
|
No one reads the website from home? |
Re: The Pesky "e"
2011-07-06 11:35
•
by
Tony Little
(unregistered)
|
Well, you eliminated one. Keep going, you CAN DO IT!
|
It hardly makes a difference to me. |
No, he's serious, it's just that he's been 'Enterprised' (notice the use of a configurable log provider and extension methods). |
Re: The Pesky "e"
2011-07-06 11:37
•
by
hoodaticus
(unregistered)
|
You still get the warning that way, dummy. It should obviously be:
...especially on a server. |
... *after* calling office automation code! WIN! |
Re: The Pesky "e"
2011-07-06 11:39
•
by
zunesis
(unregistered)
|
The idea was that you get an error message, but none of the helpful information that was in the exception. The message box on a server has been covered. |
That actually is better (at least there is *something* being outputted as opposed to the silent scream of a caught exception), but you'll still get the compiler warning. |
|
Next time you bash e, get to know it first. Thanks.
|
|
Hooray for compliant code! 'Cause the non-compliant variety is just too much for me, you know.
|
Is that a concept from Lovecraft-Driven Development (LDD)? Come to think of it, the majority of code seems to be based on primal terror. |
|
Embarassingly enough, it eluded everybody that every error and exception would endure even after eliminating the pesky "e".
|
At a minimum, I like to know what part of my code throws exceptions so I can fix the problem. |
Re: The Pesky "e"
2011-07-06 11:53
•
by
evilspoons
(unregistered)
|
Some part of me wants to give you a high five... another part of me wants to smack you. |
BUT, the point was not to fix the errors/exceptions, it was simply to remove the build warnings. |
You mean the exception would still happen, but would still be swallowed by the empty catch, right? The way I read your comment was that it would bubble up... |
If only we had 3 monthes... in France we have only 2. CA c'est le vrai WTF. |
Helloooo NEWMAN |
Yeah, I'm about as enterprisey as it gets. I've discovered that my code gets more maintainable when I have proper abstraction and domain models that describe my problems. And I've never seen non-enterprisey code that can read records from a database and package them into business objects, with exception logging, in a single line. |
I think he means that the exception wasn't actually handled. Of course, ignoring it is sometimes the answer. For instance, my exception logger class has an empty try catch around the Log method, "//because exception loggers should not throw exceptions". |
But... but... but... who's going to log the loggers?! |
Re: The Pesky "e"
2011-07-06 12:30
•
by
Big Bother
(unregistered)
|
We've always been at war with Oracle. |
Re: The Pesky "e"
2011-07-06 12:40
•
by
zunesis
(unregistered)
|
I meant "better" as in "more ironic" but whatever. |
Re: The Pesky "e"
2011-07-06 12:49
•
by
callingFoul
(unregistered)
|
And there's TRWTF - assuming developers using a language will write shite. |
Um, ok. I think you almost the comment... |
Re: The Pesky "e"
2011-07-06 12:56
•
by
tragomaskhalos
(unregistered)
|
Silently eating an exception is understandable (though not forgivable) in Java because the code won't compile without either the try ... catch or an exception specification (which then needs to be propagated to all callers). But C# does not have that problem so this is both both unforgivable *and* inexplicable ! |
Well duh, yeah... whom else would the software that behaves like a one-hundred year old vampire wistfully trying to overcome his darker nature while dating high school girls that are 85 years his junior have to fight? Did I mention the vampire's handwriting IME is so beautiful and perfect? No? Oh, well, it so totally is. |
|
I use this pattern all the time in javascript. Maybe I'm looping through an array and want to do something (call methods, change properties) that only some of the elements have. I'm too lazy to inspect each one, so I'll just try and catch.
|
Re: The Pesky "e"
2011-07-06 13:02
•
by
Lil Kim Jon Ill
(unregistered)
|
Ironic better is best better. |
I realized that, but wasn't sure if you knew that your example (although technically wouldn't compile) was actually an improvement. Anyway, excuse me while I reboot my sarcasm detector... |
Re: The Pesky "e"
2011-07-06 13:16
•
by
zunesis
(unregistered)
|
After all the times I've been ribbed on this site... |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |