- 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
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." - Red Adair
Admin
When I've seen this pattern before it's been to avoid reloading the page causing it to redo work, either because it's expensive/slow or because re-running it could have negative effects(for example posting a comment where each reload of the page would add a second copy of the comment).
Of course there are many nicer solutions people have used since forever, the most convenient IMO is a nonce generated on the calling page, and once it hits the back end you check if it's already been used, if it has you return the relevant result(cached slow page/redirect to the correct location to view what they already submitted, etc). This avoids the need for the redirect while making stuff still work as expected on reloading in a fairly seemless way.
Admin
Doing Response.Redirect without passing False as the second parameter also shows another hidden anti-pattern.
Most people end up fixing this when they eventually reach the point of maturity that they start logging errors and actually looking at them. It doesn't take long to realize that this non-error code flow where you redirected to another page on purpose, is occupying large part of the error log. A sensible developer will do a quick search or read the documentation and quickly see what they're doing wrong.
My guess is that this organization relied on their user to tell them what errors on on the site.
Admin
TRWTF is Microsoft having a method which always throws an exception. They later started recommending programmers not call that method, but still.
Admin
Yeah. Had this said almost verbatim to my face some years back.
Admin
And now it would be "1 kid and one LLM subscription.".
Admin
Strangely, the "hire [three kids out of college|one kid and an LLM subscription]" option doesn't seem to come up when recruiting for middle management.
Admin
Source: I’m now in middle management,
Admin
the funny things is that session state could expire between the generation and the redirect
Admin
That's clearly not VB.NET, though. Square brackets are used for indexing and lines end with semicolons. That's likely C#.
Admin
I once wrote all the logic to collect the information for a page and prepared a JSP template for the junior dev to do the repetitive work of printing the class fields into the HTML. I came back from my holidays only to learn that he had left the template basically untouched, and written inline JavaScript to populate it with an Ajax request.
Admin
As the person who originally sent this in, all I can say is that:
"My guess is that this organization relied on their user to tell them what errors on on the site."
...is so incredibly correct.
Admin
You're likely not wrong. IIRC I sent this in a couple of times, and it was - at one point - rewritten from VB to C#. VB was definitely the original language, though.
Admin
HPCs charge top dollar and are therefore better than amateurs?