• (nodebb)

    Obviously, echo '<li>' . $frist . '</li>' would have worked.

  • iggy (unregistered)

    actually the call would have been

    • r
    • i
    • s
    • t
    • f

    but just curious, will then the command "drop Table" drop his table?

  • Harris M (unregistered)

    That isn't even the worst PHP I've seen.

  • (nodebb)

    What's up with the "They" and "Their" when referring to Dewey. Or was the entire family 'helping' out: Hamster Huey, the gooey kablooie, Dewey Cheatem and Howe, ... who are "they"?

    Addendum 2018-09-27 07:19: I forgot about Louie

  • Jeff (unregistered) in reply to bjolling


  • Peter (unregistered) in reply to Jeff

    What's wrong with referring to Dewey as "he/his"? Since he's introduced as a nephew in the first sentence, that would seem reasonable.

  • RLB (unregistered) in reply to Peter

    Reasonable, but not foke enough.

  • King (unregistered) in reply to Applied Mediocrity

    Kudos to you for a really good frist!

  • Jeff (unregistered) in reply to Peter

    Reasonable, not mandatory.

  • thegoryone (unregistered)

    This is just a bunch of smaller transgressions added together (the array manipulation aside, that's as pointless as it is inventive). Does that make it an additive or multiplicative WTF?

  • D-Coder (unregistered)

    I was expecting Dewey to be promoted to manager.

  • Mr Bits (unregistered) in reply to Peter

    There does exist a perfectly good 3rd person non-gender-specific pronoun: it. I am continually perplexed by authors' reluctance to use it.

  • Anon The Mouse (unregistered) in reply to D-Coder

    You mean, Lead Developer

  • David Jackson (unregistered) in reply to Jeff

    True, but then it could be argued that normal English is not mandatory and we can make sense of gibberish. The use of 'he' in this case reads like normal English and is what 99% of English speakers would say (in the UK anyway). Using 'they' in this case, when we know who we are talking about, sounds unnatural and is not in this instance needed to avoid clumsy use of "He or she" (which is how 'they' is usually used). That's just my opinion of course.

  • Jshell (unregistered) in reply to Peter

    Agreed. They is supposed to be used when the gender is unknown.

    Very difficult to read like this.

  • (nodebb)

    If we're done talking about English, there's so many more WTFs in the loop.

    He's comparing the element value $list[$i] against the array length, rather than comparing the index $i. He's using <= count instead of < count, so it would access outside the array. But it's an associative array, since he used fetch_assoc(), so $i can't be used as the array index.

    And finally, there's no need for a loop -- there's only one column being fetched. If this is supposed to be looping over all the rows, that's a whole other WTF.

    Interestingly, $list == true actually works, although this is probably one of those PHP corner cases that no one should actually depend on. The array is converted to a boolean, and empty arrays become false while non-empty arrays become true.

  • Acronym (unregistered) in reply to D-Coder

    That's what "got quietly shuffled to some other part of the organization" actually means. Reagan was just lucky that Dewey was promoted to manager of something unrelated to IT.

  • Marc B (unregistered)

    The WTF description doesn't even go far enough. fetch_assoc() fetches a single ROW of data from the result set, a query which fetches only a single field, into an associative array. Dewey's using a loop to iterate a numeric index, on a 1x1 associative array that has no numeric indexes.

    Basically this code can only ever output <li></li>

  • Your Name (unregistered)

    No wonder that Reagan are very confused, to the point they can't think through the simplest programs: They evidently have a severe multiple personality disorder.

  • Yazeran (unregistered) in reply to Barry Margolin 0

    :quote: Interestingly, $list == true actually works, although this is probably one of those PHP corner cases that no one should actually depend on. The array is converted to a boolean, and empty arrays become false while non-empty arrays become true. :/quote:

    Well that ideom is also used in other languages (perl comes to mind) and it is actually somewhat sensible to just just do if (@array) instead of if(@array.length > 0)

  • tbo (unregistered) in reply to Barry Margolin 0

    Comparing an array to true is kind of common in this case, although usually it's written as

    while ($row = $result->fetch_assoc()) { ...

    as the fetch_assoc() returns false if there are no more rows.

  • Confused (unregistered) in reply to bjolling

    Like a few other posters, I am very confused about the reference to "they". The story talks only about this Dewey kid. Who else is doing copy-paste coding besides him? That's very unclear. REMY: Please fix.

  • Smash (unregistered)

    Nah, I'd rather talk about the cretinous use of "they" when talking about a unique known male.

    Maybe Dewey had a multiple personality disorder? Maybe, fancying himself a monarch HE used to refer to himself in the majestic plural and Reagan was mocking him for it? Maybe Dewey is a composite entity like a human-shaped colony of insects? Or maybe HE is Legion, for they are many?

    Those, and the avoidance of "(s)he" or "he or she" are the only cases I can see where "They" wouldn't make the text worse.

    Even if Dewey was a human of unclear gender that information wouldn't have any bearing on the WTF and could be settled on either gender during Editing stage.

  • Pjrz (unregistered)

    As always, "he’s super smart with computers" means "can turn it on and is pretty good at finding cat videos on the internet and playing Call of Duty" (or whatever the trendy shoot-em-up is these days - I may be behind the times).

    This will more than enough for any non-technical person (read: manager) to assume that the person can press that secret "create-whatever-software-I-am-thinking-of" button that he is convinced all developers have hidden in their keyboards.

  • Brian Boorman (google) in reply to David Jackson

    Dewey suffered from multiple-personality disorder. Them refers to the collective voices in his head.

  • (nodebb)

    How hard can it be?

  • Zach (unregistered)

    SMH (crying)

  • I'm not a robot (unregistered) in reply to tbo

    Implicitly casting something to boolean isn't the same as comparing it with true (at least logically - it works out the same in PHP because PHP is TRWTF).

  • ZB (unregistered)

    This is what you get for hiring a gestalt intelligence.

  • (nodebb) in reply to D-Coder

    "I was expecting Dewey to be promoted to manager." The article did say that Reagan never heard from them again. Most of the moronic managers I've had to deal with were hiders. God forbid, if anybody ever saw them, they'd have to answer a question or help with the work!

  • (nodebb) in reply to tbo

    Though considering how it's going to be used, you might as well skip ahead and write foreach($result->fetch_all(PDO::FETCH_COLUMN, 0) as $reddit).

    Also, it's odd to be attempting to refer to Dewey with a gender-neutral pronoun when he's identified as male in the very first sentence.

  • Scott Weaver (google) in reply to Jeff

    There is no good reason to EVER use a "singular they."

    https://www.theatlantic.com/entertainment/archive/2013/01/singular-their-affront-good-writing/319329/ "..I'm all for a certain flexibility and adaptive ease with regard to language and how we use it. I'm happy to add three exclamation points to a sentence or write in ALL CAPS when it seems to fit the moment, especially online. But I see absolutely no reason other than laziness to start subbing our hes and shes with a clunky they, or our hises and hers with theirs. There is a reason we have distinct pronouns, and that is so we can be specific. If we don't know the specifics, we should try to find them out, or use one of those handy words — he or she or one, for instance — that get around the they problem. Peppering one's sentences with some hes and shes can be kind of nice, really, a way to assemble a collection of characters who are certainly more real and individualized than a collective they.""

  • (nodebb)

    Actually the first images that popped into my mind with "they/them" (in spite of knowing the neutral singular usage) were:

    They (Dewey and Dewey's keboard (or uncle)) couldn’t write a line of code to save their life.

    ... StackOverflow, they (Dewey and Dewey's uncle (or keyboard)) went to r/ProgrammerHumor and copied code ...

    ... and Reagan never heard from them (the people from that other part of the organization) again (obviously!).

  • bobcat (unregistered)

    Well, if we're going to quibble on Singular They, I will just point out that, given Dewey's reliance upon what we shall delicately refer to as outside sources, 'they' could refer to him and all the coders he was copy-pasting from.

  • Bubba (unregistered)

    WTF with the dreadful usage of they/them?!?!?

    Speak english, not SJW drivel.

  • Bubba (unregistered) in reply to Jeff

    Yes, there is a usage case for singular "they" but this ain't it.

    Wife yells "there's somebody at the door!"

    Husband replies "ask them what they want!"

  • Matías Moreno (google) in reply to Developer_Dude

    They can be very hard... d'oh!

  • Anders (unregistered)

    TRWTF is people who fake surprise and unability to read and/or comprehend when non-gendered language is used. The rest of the world understands perfectly what you pretend to not understand. You're just making yourselves look even more stupid than you are.

  • (nodebb)

    How do you know which of the seventy-or-so genders does the nephew self-identify as? Maybe the correct pronoun is bzwhe. Or wtfe?

  • (nodebb)

    Another reason to use singular "they" is that not everyone identifies as either "he" or "she". Like Boolean variables, gender is non-binary.

  • sirocyl (unregistered)

    Does it work yet? Lemme work it: fetch the list down, pop it and reverse it elbat morf noitamrofni tceles, elbat morf noitamrofni tceles

    Huh, I guess Dewey got inspiration from a MySQLiot song.

Leave a comment on “Off by Dumb Error”

Log In or post as a guest

Replying to comment #:

« Return to Article