Error'd: Too Spicy For My Hat
The Daily WTF
by Lyle Seaman
17h ago
My plate has been full this week, but not as full as Walter's! "Maybe hold the cheese?" suggests Walter T. regarding a pepper and steak grinder. "Seen at Reading (MA) House of Pizza on Jul 24 2024." If you decide to search around to try to understand the different names for this kind of sandwich, you will undoubtedly discover someone trying to claim that really, the hoagie is a different sandwich from a submarine, which is different from a grinder and so on. They are wrong, and this is how we know: if they truly were different kinds of sandwiches, then somewhere on this planet would be a shop ..read more
Visit website
NPath Complexity
The Daily WTF
by Remy Porter
4d ago
We're not going to look at code today, and instead, we're going to talk about a code metric. Specifically, "NPath complexity". NPath complexity is a good metric to track, and many static analyzers will do it. Formally written, it's defined: "The NPath complexity of a method is the number of acyclic execution paths through that method." Or, more simply, not counting loop iterations, this is how many branches you have in a single method. Obviously, for simplicity's sake, this number should be small. Hell, ideally, it should be small enough that you can count it on your fingers. Ideally, small en ..read more
Visit website
CodeSOD: Serial Properties
The Daily WTF
by Remy Porter
5d ago
Jan wrote some code that set a property, and a few lines later had to write code to read that value- and the compiler complained. Which is what drew his attention to this C# code: public string ViewNodeFilter { protected get { if (viewNodeFilter.IsNotValid()) { return "null"; } return new JavaScriptSerializer().Serialize(viewNodeFilter); } set { viewNodeFilter = value; } } Now, one of the features of properties in C# is that the getter and setter can have different access l ..read more
Visit website
Error'd: Pennies From Heaven
The Daily WTF
by Lyle Seaman
1w ago
Adrian M. lit up this blooper for us. "Apparently Siemens Mobility wasn't satisfied that a mere 95-year copyright term would be enough for the brochure about their m60-series traffic light controller. I hope I won't have to wait until 2029 for a green light." See for yourself here.   Mark W. thinks Doordash needs a kiss on the boo-boo to make it all better. "Sometimes even a major app has a little mishap, the software equivalent of skidding on a wet floor or fumbling shuffling a deck of cards, and all they need is a bit of reassurance."   An Anonymous Cheapskate pinches every p ..read more
Visit website
CodeSOD: Sanitary Paths
The Daily WTF
by Remy Porter
1w ago
When accepting user input for things like, say, accessing the filesystem, you need to do some validation. Bad or inappropriate characters could lead to surprises that no one is going to like. So when Christian first spotted this C# method called SanitizePath, he didn't think much of it. But then he looked at the implementation… public static string SanitizePath(string path, char replacementchar) { string result = ""; try { // Split path and filename FileInfo fi = new FileInfo(path); string filename = FileUtilities.ReplaceInvalidFileNameChars(fi.Name, replacementchar); st ..read more
Visit website
CodeSOD: Prefixual
The Daily WTF
by Remy Porter
1w ago
Maciek has the distinct pleasure of working on Dynamics Ax, and ERP system. Like every other ERP system, it's endlessly customizable, and scriptable. In this case, scriptable in a custom language called "X++". While it's probably entirely possible to write good code under these circumstances, it's not an environment conducive to that. And that's how Maciek inherited this method: public boolean modified() { boolean ret; str itemPrefix; str itemId; ResponseCodeTable responseCodeTable; ; itemId = SalesLine_ItemId.getLine(1 ..read more
Visit website
CodeSOD: Uniquely Enough Identifiers
The Daily WTF
by Remy Porter
1w ago
Running and hosting a database is expensive. Not only do you need the server for it (even if you rent in the cloud), you also need the expertise to administer it. And that's why Lucas ended up working on an application which used Google Sheets as its database. Now, this was an application used by a marketing team to create new marketing campaigns, so Google Sheets wasn't the worst choice made in the entire process. With only a handful of users and dozens of records, it was fine. You didn't need to put a huge amount of effort or expertise into it- at least, that's what management thought. The a ..read more
Visit website
Error'd: Watching the Days
The Daily WTF
by Lyle Seaman
2w ago
This week, we saw some unexpected results in UK politics. Nothing was more unexpected than the dark-horse results that Richard and a few anonymice remarked on. "A glorious victory for the Undefined party!" crowed Richard "The UK general election has seen a surge of support for minor parties."   Some numbers are lucky. Michael R. sympathizes with the unlucky ones. "I reckon 1 and 5 are feeling left out."   Phil J. bought a thing, and muses "I hope they took my money." 'Twere me, and I'd hope they didn't.   Gordon S. has a little storage crunch. "It would be nice to free ..read more
Visit website
Best of…: Classic WTF: Cluster#$%&
The Daily WTF
by Mark Bowytz
2w ago
Reliability is its own, very important art. Unless you're, say, Google, you shouldn't write your own reliability systems, but instead buy solutions from a vendor. Just not this vendor. Original. --Remy It was a little past 4AM when Massimo's support pager went off, jarring him awake. Without even looking at the pager or logging into his laptop, he flipped on the television to Channel 242: the Video on Demand channel for the Italian TV broadcaster that he worked for. Nothing. Grumbling as he got dressed, Massimo knew that, again, now for the third time this month, he was going to have to go int ..read more
Visit website
Best of…: Classic WTF: Python Charmer
The Daily WTF
by Alex Papadimoulis
2w ago
When comparing your language to a snake*, be careful to not get bitten. (*Yes, I know, the name of the language is a reference to Monty Python, not snakes). Original. --Remy "I don't have a whole lot of experience in Python," writes Jakob, "in fact, when I was hired, the only thing I knew about the language was that whitespace was important." "Fortunately — actually, unfortunately — it doesn't take a whole lot of experience in Python to recognize that my company's codebase is... well... sub-optimal. Submitted for your approval is a method used to generate a password, found in our network secur ..read more
Visit website

Follow The Daily WTF on FeedSpot

Continue with Google
Continue with Apple
OR