- 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
My best/worst guess for what this is meant for: aligning something with the longest string. Like, write something to console, CR to jump to start of line, write the "prefix" to console, then write whatever should come after.
Of course, this is just a guess, but it's the kind of kludge I'd expect with code this clumsy-looking.
Edit Admin
My years of experience tell me that, clearly, the method named "ErrorForm" actually logs and/or emails the exception so that the developers are made aware of the problem and can fix it.
Admin
And once everybody got fed up of errors that were never fixed, public override ShowDialog() {} was added to ErrorForm.
Edit Admin
I've seen this one before but in this instance the inner code did produce a error with MessageBox so in case of error the user had to start closing MessageBoxes until the code ran out of messages. They fixed it by putting all the error messages in a StringBuilder and displaying a single hard to read MessageBox covering half of the screen. Wasted work if you ask me because most users, in my experience, don't read error messages.
Admin
What a bunch of unnecessary garbage creation, and a for loop wouldn't be any better than a while loop when `new string(' ', maxLength)' would do the job in one line without throwing away any garbage strings.
Admin
Why Prefix? Because you then do left(strPrefix, len(strPrefix)-len(strLabel)+strLabel) and get right-aligned labels. Clearly on a fixed-width terminal, even on the new-fangled amber ones :-)
Edit Admin
Users don't read the error messages even when they say "your error is here and this is how you fix it".
Edit Admin
Users, I'm happy when testers and support read error messages. In a previous job, the bug tracker was littered with hundreds of bugs that said "user got an error when ...". In most cases, it turns out that the error (which the support person never read) was "User is not authorized to perform operation XXXX".
Edit Admin
Straight to prison, 25 to life.
Edit Admin
I wish some of my fellow developers would read error messages just a little more often...