- 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
Brillant idea! Think I'll do that frist chance I get.
Admin
hope it works with my form where the email is called item_5
Admin
Just leave your name, address, and ctl00$ctl00$ctl00$ContentPlaceHolderDefault$cp_content$ctl02$RenderForm_1$rpFieldsets$ctl00$rpFields$ctl04$126d33a3_9f7f_4583_8c94_5820d58fc030 and I'll get right back to you!
Admin
"WorkPhone" is checked twice, WITH SAME SPELLING!
Admin
Question 12: Why?
Admin
Well, ,obviously. It probably has an NBSP buried in one of the two cases.
Admin
It just.... keeps.... going...
Admin
At least it is formatted nicely!
Admin
I imagine that formatting was added by the submitter or TRWTF. The original is probably all on long line.
Admin
This code needs to also use a database, a blockchain, some AI, non-fungible tokens and a social network and it will be just as useful.
Admin
And I'd bet that TRWTF is a crappy, unconfigurable Enterprise Web App Framework (tm) which makes this the only solution that works.
Admin
'Default$Content$FormViewer$FieldsRepeater$ctl04$ctl00$ViewTextBox' is also named twice. Good thing they've got that so well covered.
Admin
Simple - they did this for one customer, and it worked great. But then another customer wanted it, and their fields were different, and somebody made the decision to stick in a quick-n-dirty hack rather than refactor the whole thing to be customizable. And thus was a precedent set.
Admin
I should have made my question clearer. It also applies to Questions 7, 51, 59, 35, 67 and 43. As per the OP.
I'm almost impressed by the fact that this ingenious craptraption almost handles I18N, though.
Admin
Fucking yikes
Admin
You are not being totally fair, it doesn't always check the field name, sometimes it also uses the url and frmId to make the decision:
I think I'm hoping that frmid is actually a customer id, not none unique supposedly unique form identifier. Either way it is even worse than it looks from the first 20 lines..
Admin
Archeologists trying to reconstruct the history of server-side web frameworks will use this as a Rosetta Stone ... well, maybe as Rosetta Tissue Paper.
Admin
They covered ALL their bases.
Or did they?
Admin
I'm going to bet this code is generated by a tool that screenscrapes the forms to learn what the element IDs are. Holy circular stupidity WTFMan!
Admin
TRWTF is their code review process: NINE lines are duplicated -- and all but three of them are within a dozen lines of each other.
Admin
I think TRWTF is people actually counting the number of duplicates in this code...
Admin
But hey at least they used line breaks, assuming those weren't added just for posting it here.....
Admin
@ZZartin
The fact it was so well formatted was part of the reason I figured it was bot-generated code, not cut-and-pasted code.
Admin
Lets climb the ladder
to perfect code. The larger the ladder, the more perfect the code. (many duplicates included to help the ladder grow).
Admin
Two txtPhone as well
Admin
When I was in Uni we did soem functional Programming in some weird teaching dialect of Racket (Dr. Racket or something); I got points subtracted on the part of the question "recognise and abstract partial problems" (original was in german); For not making x^2 its own function. They literally subtracted me a point for making a whole new function instead of simply writing x*x (In an area calculation, no way we'd have a different exponent)
So yeah premature abstraction sadly was a requirement to get full marks on that course.
Admin
It's a pity that I use
ctl00$ctl00$templateMainContent$homeBanners$HomeBannerList$ctrLeads$txt_5_1
as the first line of the address on my form, not the phone number; that'sctl00$ctl00$templateMainContent$homeBanners$HomeBannerList$ctrLeads$txt_5_54
Admin
Well, your users are just going to have to remember that the first line of their address needs to be formatted like a phone number.
Admin
I once came across a program that checked the query string for a field named either "cid" or "customer_id", and took either one. And I thought, Why? Why? The only links to this page (that we care about) are in pages that we wrote. When you were writing the code and found that you were passing in a query string parameter with a different name, instead of changing the target to accept either name, why didn't you just change the source to use the same name? I found one place that was using the long name, and changed it to the short name. But I was afraid to remove the check for both names for fear that there's someplace lurking out there that I didn't find, like somebody wrote query_string="customer_" & "id".
Admin
"TRWTF is their code review process: NINE lines are duplicated -- and all but three of them are within a dozen lines of each other."
Well, duh. Some of these names are used in two callers, so of course they have to check for them twice ...
Admin
A Form of Refuse
Admin
There are also links which people pasted into their emails, links which people bookmarked, links indexed by google, and links from archives and other links which your (current or potential) customers may come across, which would provide a better experience if they continued to work.
So if your old system used customer_id, and your new system uses cid, it makes sense to check for customer_id and stuff that into the cid before continuing.
Admin
my name is missing wrote:
It would also be shorter.
Admin
this reminds me of something...some system would try to load ALL flies in the ENTIRE network into a PC EVERY time ANY employee pressed ANY key on their keyboards! this would not be so bad for a small company with 20 users, but for a big one with 200 users...EVERYTHING LAGGED TERRIBLY.
Admin
All your form field are belong to us