Feed aggregator
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.
'Something Has Gone Seriously Wrong,' Dual-Boot Systems Warn After Microsoft Update
Read more of this story at Slashdot.
Toyota Confirms Breach After Stolen Data Leaks On Hacking Forum
Read more of this story at Slashdot.
'Civilization 7 Captures the Chaos of Human History In Manageable Doses'
Read more of this story at Slashdot.
Federal Judge Strikes Down Ban On Worker 'Noncompete' Agreements
Read more of this story at Slashdot.
OpenAI Announces Content Deal With Conde Nest
Read more of this story at Slashdot.
'The Pirate Bay' TV Series Teaser Appears Online
Read more of this story at Slashdot.
Nvidia Is Ditching Dedicated G-Sync Modules To Push Back Against FreeSync's Ubiquity
Read more of this story at Slashdot.
Your TV Set Has Become a Digital Billboard. And It's Only Getting Worse.
Read more of this story at Slashdot.