- 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
Obviously,
echo '<li>' . $frist . '</li>'
would have worked.Admin
actually the call would have been
but just curious, will then the command "drop Table" drop his table?
Admin
That isn't even the worst PHP I've seen.
Admin
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
Admin
https://en.wikipedia.org/wiki/Singular_they
Admin
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.
Admin
Reasonable, but not foke enough.
Admin
Kudos to you for a really good frist!
Admin
Reasonable, not mandatory.
Admin
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?
Admin
I was expecting Dewey to be promoted to manager.
Admin
There does exist a perfectly good 3rd person non-gender-specific pronoun: it. I am continually perplexed by authors' reluctance to use it.
Admin
You mean, Lead Developer
Admin
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.
Admin
Agreed. They is supposed to be used when the gender is unknown.
Very difficult to read like this.
Admin
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.
Admin
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.
Admin
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>
Admin
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.
Admin
: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)
Admin
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.
Admin
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.
Admin
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.
Admin
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.
Admin
Dewey suffered from multiple-personality disorder. Them refers to the collective voices in his head.
Admin
How hard can it be?
Admin
SMH (crying)
Admin
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).
Admin
This is what you get for hiring a gestalt intelligence.
Admin
"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!
Admin
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.
Admin
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.""
Admin
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!).
Admin
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.
Admin
WTF with the dreadful usage of they/them?!?!?
Speak english, not SJW drivel.
Admin
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!"
Admin
They can be very hard... d'oh!
Admin
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.
Admin
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?
Admin
Another reason to use singular "they" is that not everyone identifies as either "he" or "she". Like Boolean variables, gender is non-binary.
Admin
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.