Feed aggregator
Sonos CEO Says the Old App Can't Be Rereleased
Read more of this story at Slashdot.
App Store VP Departs As Apple Prepares Organizational Changes
Read more of this story at Slashdot.
Google Agrees To $250 Million Deal To Fund California Newsrooms, AI
Read more of this story at Slashdot.
IT Tycoon Mike Lynch, Daughter Hannah Found Dead
Read more of this story at Slashdot.
Microsoft Copilot Studio Exploit Leaks Sensitive Cloud Data
Read more of this story at Slashdot.
Rotten Tomatoes Introduces a New Audience Rating For People Who Actually Bought a Ticket
Read more of this story at Slashdot.
Intel Discontinues High-Speed, Open-Source H.265/HEVC Encoder Project
Read more of this story at Slashdot.
Google Can't Defend Shady Chrome Data Hoarding As 'Browser Agnostic,' Court Says
Read more of this story at Slashdot.
Microplastics Are Infiltrating Brain Tissue, Studies Show
Read more of this story at Slashdot.
Linux Market Share Hits Record High
Read more of this story at Slashdot.
South Africa's Telco Industry Calls For Tech Firms To Help Fund Infrastructure
Read more of this story at Slashdot.
CrowdStrike Unhappy With 'Shady Commentary' From Competitors After Outage
Read more of this story at Slashdot.
US Feds Are Tapping a Half-Billion Encrypted Messaging Goldmine
Read more of this story at Slashdot.
Slack AI Can Be Tricked Into Leaking Data From Private Channels
Read more of this story at Slashdot.
Microsoft's White Xbox Series X and 2TB Special-edition Model Launching in October
Read more of this story at Slashdot.
Missing Scissors Cause 36 Flight Cancellations In Japan
Read more of this story at Slashdot.
Valve Bans Razer and Wooting's New Keyboard Features In Counter-Strike 2
Read more of this story at Slashdot.
China Is Backing Off Coal Power Plant Approvals
Read more of this story at Slashdot.
CodeSOD: Do a Flip
Kendall found some recently written code, and had to wonder, "Who wrote this crap?" Much to Kendall's disappointment, source control knew who wrote it: Kendall.
if (x < 0.0) { x += 0.0 - x; width -= 0.0 - x; }Kendall didn't share the purpose of this code, but based on starting with a less-than-zero check, I suspect the goal was to do something akin to an absolute value. If x is less than zero, make it positive.
That's certainly what was attempted. 0.0 - x, where x < 0 would be the same as x * -1. Unfortunately, Kendall added that to x, making x zero.
As with a disappointingly large quantity of bad code, this got committed without any tests, rolled out to production, and created head-scratching bugs for months. Eventually, the bugs became annoying enough that they bubbled up to the top of the priority list, and Kendall was tasked with fixing them.
The other reason I think the goal was essentially an absolute value operation is Kendall's commentary:
Aside from the major bug, this code is a sure indicator of overthinking things.
It is an overly complex way to flip the sign, yes. But "overthinking?"
The line between overthinking and underthinking is a thin line indeed.
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!US Birthrate Hits New Low, CDC Data Shows
Read more of this story at Slashdot.