- 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
Oh? http://translate.google.com/#de|sv|Matterhorn
Google translate is not spam askimet
Admin
Make fun of gods and gods will truble you!
Admin
People like you? You mean american douchebag pretending to be indian developer?
Admin
Admin
yes - someone did something stupid. Although from memory this is actually somewhat valid (as I recall, a more meaningful message would have been "Could not create additional/intended dialog box". Anyway, it doesn't actually have any relevance to what you quoted.
Why shouldn't this exception (assuming it was even an exception) be caught and handled?
Admin
Admin
An exception which shouldn't be handled....
Here's one I DO use "On Error Resume Next" for:
... txtSomeTextBox.SetFocus ...
Setting the focus isn't critical, only a nicety. The fact that VB6 blows up with an Illegal function call if it can't set the focus (perhaps its on a hidden window) is beyond me.
I've had to write so much VB6 code I broke down on the 3rd day of my previous job and wrote a tool to automate writing of error handlers for VB 5/6. My code is slathered in error handlers, most of which DO report errors to the user, and the location thisform->thisfunction, etc, and also writes to an error log file. Errors in the applications I write shouldn't happen. I want the user to call for help if one happens. My favorite type of "user error" just happened again.
My (inherited) application currently uses Access (yes yes, double evil, VB6 and Access). Works great for 99.99% of people. Small app, small DB, not much going on, so using some fancy DB for it is asking for more trouble than it's worth (I've been tempted to go to flat files, it's so small).
Anyways, user calls support for help, can't run reports, says file already open or DB already locked by another user... on a single user system. User swears up and down this is the first time he's had trouble. Finally, I ask for the error log... very first error is from the previous friday, this was a monday.... and what did it say? "Unrecognized database format.". But since it only happened when he logged off the program, it didn't occur to him that this might be a BAD thing.
So I got to spend several hours manually copying records out of his database to a new one since Access and all its tools couldn't repair it. And he got to spend quite a few hundred dollars for me to do it. (of course he didn't have backups, don't even THINK about asking that).
Error logs, how I love thee....
Admin
sorry - I didn't realise that I was obligated to laugh at something of no relevance. What did you want me to say..
"LOL, OMG, ROFFLE, THAT IS SO FUNNY BECAUSE IT SAYS IT CANNOT CREATE A DIALOG BOX, BUT IT DID!!! OMG... GET IT??"
Post something which is both relevant and amusing, and I'll give it the credit it deserves.
Admin
You do realise that by putting "On Error Resume Next" you are actually handling the error, right?
Admin
I actually just tried that code, the output from gcc was actually quite funny:
$ gcc -lm test.c /tmp/ccKPC5nw.o: In function
main': test.c:(.text+0x11): warning: the
gets' function is dangerous and should not be used.And of cause te resulting executable segfaulted.. :-)
Admin
What? You did not have auto-backup system?
Admin
Admin
I don't consider ignoring it to be "handling" it. I write error handlers to handle errors.... ;)
Admin
FTFY
Admin
Admin
Heh. We all know the capabilities of the average computer user.
I've actually had the "CD-rom tray as coffee cup holder" and the "insert CD-ROM into 5.25" drive (and wonder why it comes back out scratched)" customer support nightmares...
Admin
Admin
C has UNIX signals, which are essentially exceptions. For example, signal 13, SIGBUS, is like IOException. "Segmentation fault", SIGBUS, is a NullPointerException.
Admin
That's TRWTF right? Or is it just people who use "registry cleaners?"
Admin
Admin
Admin
Stack corruption or heap management block corruption. Any attempt to handle will allow an exploit.
Admin
The real vista fix:
Admin
My hope was that you would run that code and come across an error handling mechanism which is not similar to "on error resume next". Just out of curiosity, could you please tell me what you think the code I posted actually does?
No, the return codes are neither here nor there. The following is just as bad, even though it assiduously checks every return code it sees (I changed 0 into c just so that I can distinguish gets() failing from gets() succeeding). If you can't run it, please tell me what you think happens if the code encounters an error? They're quite right to say that. gets() is still in the standard, though, so it compiles perfectly well.Admin
On Error Resume Using Language That Is A Blight On Computing.
Admin
The very fact that "on error resume next" is even allowed is itself a WTF. It might as well be called "crash blindly on and destroy all data". VB never has been and never will be a proper programming language.
Admin
My best guess is that 'Trent' is an consultant from accenture. Because I have all the same feelings for the code that I got handover, that michael had about trents code, from consultants at accenture.
Admin
You're right. TDWTF has never been the same since Fark culture infiltrated.
Admin
From the statement in bold, I assumed you were suggesting that every procedure required a handler because exceptions weren't able to leave the local scope.
Given that you weren't, I'm confused why every procedure would need a handler. I would expect only to catch where appropriate. In some you'd even want to raise custom exceptions specifically for the benefit of callers.
It falls a long way short of proper try/catch of course, but you can coerce useful protection out of it with careful use.
Admin
Me: Brodey.
Code:
int main(int argc, char **argv) { printf("Hello World.\n"); return 0; }
Result: No bugs. Eff off.
Admin
What's the job for?
Admin
You don't check the return code from printf. What if i redirect output to a read only file?
Admin
No function printf available. (you forgot the include) No entry point for a console app for Windows
Admin
UGH! It's hard to think someone ever would use this line of code, but it's sadly true.
I was recently tasked with rewriting several VBScripts into a C# executable. Unfortunately, I found "On Error Resume Next" all over the place. Thanks to this one-line-devil, it took me more than twice as long to figure out what the program "is supposed to do" VS "actually does".
Admin
Linus Torvalds, Donald Knuth, Bill Gates, Mark Zuckerberg.
Admin
Waiting to see an analysis of (presumably proprietary) code by Microsoft, among others. Matthew, get on the horn.
Admin
I don't like to handle exceptions. It gets my hands all icky.
Admin
CS programmers will make technically perfect code that doesn't work. Non-CS programmers tend to write sloppy code that somehow works. Put two in a room and you will usually get something pretty good or the CS guy doesn't make it out of the room.
Admin
Bubblesort is neat. But then again I enjoy that Zen moment when two pieces of bread come together to 'become' a sandwich. Ontology.
Life is much more fascinating once you force yourself not to take it for granted.
Admin
Epic fail.
I would like you to debug failure at client sites due to unknown variables (another process is fudging with your files, webservice calls, etc.) without having an app terminate with an error.
Or how about your client finds out months too late, that all the data he thought he was backing up to your cloud, didn't get there.
If there is an exception, and it's one that halts progress, the app should terminate with a hard error.
Living in a world without errors is a fantasy, unless you have a very simplistic program that doesn't work with files, webservices, databases, or any other methodology where data can be corrupted external to your app. I suppose a nice calculator app would work fine.