- 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
This code makes me sad as a software engineer. Hard to believe that people out there are writing shit like this.
Admin
Because everything is bigger in Texas!
Admin
Admin
Admin
It's look and feel
Admin
Hey! that is my script! Where did you get it?
Admin
Admin
Just be glad it doesn't have a dollar sign.
Admin
Could we please have more comments that "Everything is bigger in Texas"? (I think we're pretty much agreed that neither short-term memory nor IQ are included in "everything" for the sake of this discussion.)
Admin
Admin
You had a single page form, with ONE HUNDRED AND FIFTY DROP-DOWN BOXES, each containing 75 options? OUCH! I'd be bored and wander away long before reaching the bottom of the form...
What kinds of situation would require such a monstrosity?
Admin
It is obvious the coder just copied a snippet, didn't understand how it worked, and then just fiddled with it until it kind of did what was expected. This was most likely a government employee.
Admin
Why would you spoil code as funny as that.
Admin
[applaudes]
Admin
just because pay is based on LOC wouldnt mean you have to hand type it.
If I WAS paid by LOC, I might do something like the above, but I would definely cut/paste or even script the writting of the whole thing
Admin
With less repetition (in PHP):
$states = array("AL" => "Alabama", "AK" => "Alaska"); // etc. echo "<select name='usr_state'>\n"; foreach ($states as $abbrev => $full) { echo "<option value='$abbrev'" . ($abbrev === $state ? " selected" : "") . ">$abbrev - $full</option>\n"; } echo "</select>\n";