Computer
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.
Smartphone Maker Nothing Mandates Full-Time Office Return, Urges Dissenters To Quit
Read more of this story at Slashdot.
Atari Announces the 7800 Plus Console Coming This Winter
Read more of this story at Slashdot.
Windows 0-Day Was Exploited By North Korea To Install Advanced Rootkit
Read more of this story at Slashdot.
North America Added a Whole Silicon Valley's Worth of Data Center Inventory This Year
Read more of this story at Slashdot.
Disney Gives Up On Trying To Use Disney+ Excuse To Settle a Wrongful Death Lawsuit
Read more of this story at Slashdot.
Maria Branyas, World's Oldest Person, Dies in Spain at 117
Read more of this story at Slashdot.
Authors Sue Anthropic For Copyright Infringement Over AI Training
Read more of this story at Slashdot.
Have CEOs Changed?
Read more of this story at Slashdot.