CodeSOD: On Deep Background
The Daily WTF
by Remy Porter
11h ago
Andrew worked with Stuart. Stuart was one of those developers who didn't talk to anyone except to complain about how stupid management was, or how stupid the other developers were. Stuart was also the kind of person who would suddenly go on a tear, write three thousand lines of code in an evening, and then submit an pull request. He wouldn't respond to PR comments, however, and just wait until management needed the feature merged badly enough that someone said, "just approve it so we can move on." int iDisplayFlags = objectProps.DisplayInfo.BackgroundPrintFlags; bool bForceBackgroundOn = fal ..read more
Visit website
Error'd: Artificial Average Intelligence
The Daily WTF
by Lyle Seaman
3d ago
I have a feeling we're going to be seeing a lot of AI WTFerry at this site for a while, and fewer stupid online sales copy booboos. For today, here we go: Jet-setter Stewart wants to sell a pound, but he's going to have to cover some ground first. "Looks like Google are trying very hard to encourage me to stop using their search engine. Perhaps they want me to use chatGPT? I just can't fathom how it got this so wrong."   Tim R. proves that AIs aren't immune to the general flubstitution error category either. "I'm not quite sure what's going on here - there were 5 categories each with t ..read more
Visit website
CodeSOD: Not Exactly Gems
The Daily WTF
by Remy Porter
4d ago
Sammy's company "jumped on the Ruby on Rails bandwagon since there was one on which to jump", and are still very much a Rails shop. The company has been around for thirty years, and in that time has seen plenty of ups and downs. During one of those "ups", management decided they needed to scale up, both in terms of staffing and in terms of client base- so they hired an offshore team to promote international business and add to their staffing. A "down" followed not long after, and the offshore team was disbanded. So Sammy inherited the code. I know I'm generally negative on ORM systems, and tha ..read more
Visit website
Representative Line: Whitespace: A Frontier
The Daily WTF
by Remy Porter
5d ago
Tim has been working on a large C++ project which has been around for many, many years. It's a tool built for, in Tim's words, "an esoteric field", and most of the developers over the past 30 years have been PhD students. This particular representative line is present with its original whitespace, and the original variable names. It has been in the code base since 2010. Assignment::Ptr ra = Assignment::makeAssignment(I, addr, func, block ..read more
Visit website
CodeSOD: Device Detection
The Daily WTF
by Remy Porter
1w ago
There are a lot of cases where the submission is "this was server side generated JavaScript and they were loading constants". Which, honestly, is a WTF, but it isn't interesting code. Things like this: if (false === true) { // do stuff } That's absolutely the wrong way to do that, and I hate it, but there's just so many times you can say, "send server-side values to the client as an object, not inline". But Daniel's electrical provider decided to come up with an example of this that really takes it to the next level of grossness. var isMobile = "" === "true"; var isAndroid ..read more
Visit website
CodeSOD: No Limits on Repetition
The Daily WTF
by Remy Porter
1w ago
Just because you get fired doesn't mean that your pull requests are automatically closed. Dallin was in the middle of reviewing a PR by Steve when the email came out announcing that Steve no longer worked at the company. Let's take a look at that PR, and maybe we can see why. $originalUndrawn = DecimalHelper::toDecimal($party->limit)->sub(DecimalHelper::toDecimal($party->drawn)); This is the original code, which represents operations on investments. An investment is represented by a note, and belongs to one or more partys. The amount that can be drawn is set by a ..read more
Visit website
Error'd: Retry Fail
The Daily WTF
by Lyle Seaman
1w ago
Decreasingly hungry thrillseeker Weaponized Fun has second thoughts about the risk to which they're willing to expose their palate. "In addition to Budget Bytes mailing list not knowing who I am, I'm not sure they know what they're making. I'm having a hard time telling whether 'New Recipe 1' sounds more enticing than 'New Recipe 3.' I sure hope they remembered the ingredients."   An anonymous reader frets that "The Guardian claims an article is *more* than 7 years old (it's not, as of today, January 26)" Date math is hard.   "Oh snap!" cried The Beast in Black I feel like we'v ..read more
Visit website
CodeSOD: Does This Spec Turn You On?
The Daily WTF
by Remy Porter
1w ago
I'm a JSON curmudgeon, in that I think that its type-system, inherited from JavaScript, is bad. It's a limited vocabulary of types, and it forces developers to play odd games of convention. For example, because it lacks any sort of date type, you either have to explode your date out as a sub-dictionary (arguably, the "right" approach) or do what most people do- use an ISO formatted string as your date. The latter version requires you to attempt to parse the sting to validate the data, but validating JSON is a whole thing anyway. But, enough about me being old and cranky. Do you know one type J ..read more
Visit website
The Big Refactoring Update
The Daily WTF
by Remy Porter
1w ago
Today's anonymous submitter spent a few weeks feeling pretty good about themselves. You see, they'd inherited a gigantic and complex pile of code, an application spread out across 15 backend servers, theoretically organized into "modules" and "microservices" but in reality was a big ball of mud. And after a long and arduous process, they'd dug through that ball of mud and managed to delete 190 files, totaling 30,000 lines of code. That was fully 2/3rds of the total codebase, gone- and yet the tests continued to pass, the application continued to run, and everyone was just much happier with it ..read more
Visit website
CodeSOD: Contains Bad Choices
The Daily WTF
by Remy Porter
2w ago
Paul's co-worker needed to manage some data in a tree. To do that, they wrote this Java function: private static boolean existsFather(ArrayList<Integer> fatherFolder, Integer fatherId) { for (Integer father : fatherFolder) { if (father.equals(fatherId)) return true; } return false; } I do not know what the integers in use represent here. I don't think they're actually representing "folders", despite the variable names in the code. I certainly hope it's not representing files and folders, because that implies they're tossin ..read more
Visit website

Follow The Daily WTF on FeedSpot

Continue with Google
Continue with Apple
OR