• (nodebb)

    You wait time is frist minutes.

  • Officer Johnny Holzkopf (unregistered) in reply to nerd4sale

    I waited 0 hour and secnod minutes. Erm, snecod minute.

  • (nodebb)
    if (minutes === thrid) { waitTime = "Your wait time is 12 quatloon"); }
    
  • (nodebb)

    Isn't x = parseInt(12, 10) the same as x = 12?

  • Darren (unregistered) in reply to jeremypnet

    That's what I thought. I looked up the 'parseInt' function and from my reading the 'minutes' value will always be 12.

  • Vera (unregistered)

    "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.

  • Smithers (unregistered)

    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.

    because who cares about pluralization?

    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 the else 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.

  • Pag (unregistered)

    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.

  • (nodebb) in reply to Smithers

    Just beat me to it.

    Note the line var minutes = parseInt( 12 , 10);. This is rendered from the backend, which is of course my least favorite way to send data from the server side to the client side.

    If you replace all of the instances of 12 and 0 with what the values would be if minutes was in the range checked by the if, the code makes more sense. It's still a major WTF, but at least it isn't just plain completely insane.

  • Malte (unregistered)

    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.

  • (nodebb) in reply to Smithers

    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.

  • ttlanhil (unregistered)

    This is rendered from the backend, which is of course my least favorite way to send data from the server side to the client side

    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"

  • (author) in reply to huppenzuppen

    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?

  • (nodebb)

    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.

  • Robin (unregistered)

    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.

  • (nodebb)

    Was this coded by AI? And a terrible one at that? I don't see any other way this code could even exist.

  • GW (unregistered)

    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"

  • (nodebb) in reply to sudgy

    You don't have much experience with bad programmers, do you?

Leave a comment on “On Hold”

Log In or post as a guest

Replying to comment #701555:

« Return to Article