- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Princess Pricing
- Einfach so
- Kaids Hen 2025
- Fi fa foe
- Microbits
- No Rush
- Bridge for Sale
- Super SEO Strategies
-
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
You wait time is frist minutes.
Admin
I waited 0 hour and secnod minutes. Erm, snecod minute.
Admin
Admin
Isn't
x = parseInt(12, 10)the same asx = 12?Admin
That's what I thought. I looked up the 'parseInt' function and from my reading the 'minutes' value will always be 12.
Admin
"12 minute" might have been intended as "1-2 minutes", which raises the question where the dash went. Eh, just add it to the mountain of questions about this piece of malware.
Admin
I think I get it. The split between client and server logic is the WTF (and the parseInt is pointless), but this does actually work.
This code does. This whole code exists for the express purpose of caring about pluralisation! Because (and I'm guessing here, but I'm fairly confident) ALL of the 12s and 0s in the text strings are rendered server-side.
So at 1 minute, it will put a 1 in all the text strings but the user only sees the
if ( minutes < 2) { time.innerText = "Your estimated wait time is 1 minute." }case, which has the correct singular. From 2 to 59 minutes you get theelse if (minutes < 60) { time.innerText = "Your estimated wait time is $n minutes." }case. At 60 minutes it will render 1 instead of 0 and you get told "1 hour."(minutes < 120 && (minutes % 60 === 1)), which could be shortened to(minutes === 61), gets "1 hour and 1 minute" and so on.Heck, the source code probably looks sane if you forget that there's a step in between executing the server-side code and the client-side.
Admin
Yes, 0 (hours) and 12 (minutes) are surely variables on the server side. It will output "1 hour", "1 hour and 1 minute", "1 hour and 2 minutes" and so on, depending on what numbers are slotted into the template.
Admin
Just beat me to it.
If you replace all of the instances of
12and0with what the values would be ifminuteswas in the range checked by theif, the code makes more sense. It's still a major WTF, but at least it isn't just plain completely insane.Admin
The code does make sense. At this point we can reverse engineer the backend-code pretty easily. E.g. it starts with "if minutes < 2, the output is: 'Your waiting time is <minutes> minute.' " Which makes sense and pluralizes correctly.
Admin
TRWTF is Remy, who understood that the 12 in the parseInt() line is coming from the server, but does not recognize the same number 12 (and the 0==12/60) coming from the server inside the strings.
Admin
least favourite common way, perhaps - I'm sure there are people out there trying to reinvent a triangular wheel of data transfer, probably to make it "more secure"
Admin
No, I get that, it just still makes no sense to me at all. Like sure, the "if < 2, output '12 minute'": I get that's server side rendered. I still don't understand why that's there?
Admin
Twelve numbers on a clock. Clocks strike four times every hour. TRWTF is not knowing what either of these things represent!
Addendum 2026-07-07 09:58: EDIT: The other WTF is why anyone would set a variable to an arbitrary value and then test for seven possible conditions based on that value, which does not appear to change between the time it is set and the beginning of the test two lines later in the same code block.
Admin
Almost lost in the giant pile of WTF here, is using parseInt (a function for parsing a number out of a string), on something that is always a number.
Or, given that the main WTF is generating hardcoded JS code from some sort of server-side template (as opposed to doing it properly and just generating the correct HTML in the first place with no JS needed), perhaps that server-generated value (12 in this instance) isn't guaranteed to be purely numeric. Which would add even more WTF to the festering heap.
Admin
Was this coded by AI? And a terrible one at that? I don't see any other way this code could even exist.
Admin
What is going on today?! I just finished reading today's edition of The Daily Cartoonist, https://www.dailycartoonist.com/index.php/2026/07/07/csotd-the-red-menaces/ and it has a link to a video that compares "Airplane" with "Zero Hour"
Admin
You don't have much experience with bad programmers, do you?
Admin
Amazingly, I can agree that the code is fine (it tells you "Your estimated wait time is 12 minutes." when the minutes left are 12), and I can also agree the code is a WTF because there's some weird code-generation diarrhea going on...
Admin
But wait! There's more!
Admin
Or you could make it friendly. If the amount of minutes is 2 or less, you could say "Your wait is a couple of minutes". You could calculate the hours of it's over 60 - "your wait is about an hour" or "it's at least X hours".
If it's between a couple of minutes and an hour you could separate it to "about half an hour" or "about 45 minutes".
I'm not sure exact hours for waiting are terribly useful at this point - "your wait time is 37 minutes" doesn't seem very useful to me unless the wait is exactly that long.
Admin
I'd say it is human and not AI. I know (too) many programmers who have not fully grasped the difference between client- and server-side code and would happily write code that looks a lot worse after being rendered server-side, and are happy when it works (and unhappy when it does not as you cannot code a server-side condition based on a client-side variable of course).
I think we all agree is in this case, either do it all server side (and output just one string, with proper escaping if needed) or do it all client-side.
Admin
I take it by 'rendered', Remy means 'generated'. A small change in wording which makes this more comprehensible. It doesn't make it any less WTFy, but presumably the code in the server is something like
And if it's like that, the way it generates is a WTF, not just what it generates
Admin
The term "rendered" is often applied to templates in web dev.
Admin
Wait times are to 99% implemented as part of dark patterns and the rest of thr time they exists to save cost. There is not technical reason, in both cases they exist to extract the maximum amount of value from the user. The best way to interact with a service like that is to block permanently the URI and never go back again :-)
Admin
Given that the purpose of a lot of software is in fact to extract the maximum amount of revenue from the user I would argue that is a very valid technical requirement.
Admin
I'm not talking about client-side/server-side issues, I'm talking about the blatant mismatching between the numbers checked and the numbers output.
Admin
That is the part that correctly pluralizes (well, singularizes, if that's a word) the min<2 case. Let's say minute is 1. Then the parseInt sets minute to 1, and this condition evaluates to true, and the output is "Your estimated wait time is 1 minute." Which is as correct as you can want it to be.
I still consider the whole construction a WTF. If you can inject the number 12 into the strings in all these cases, you might as well build the sentence with the correct plural form. Or just shorten it to "Estimated waiting time: <hours> hours <minutes> minutes" and avoid all the language fiddling. Most users survive reading "1 minutes" even though that's slightly wrong grammar.