Feed aggregator
Sonos Delays Two New Products As It Races To Fix Buggy App
Read more of this story at Slashdot.
Chess Player Suspended After Allegedly Poisoning Her Rival
Read more of this story at Slashdot.
Google DeepMind Develops a 'Solidly Amateur' Table Tennis Robot
Read more of this story at Slashdot.
Apple Revises EU App Store Rules Amid Ongoing Investigation
Read more of this story at Slashdot.
China's Drivers Fret as Robotaxis Pick Up Pace and Passengers
Read more of this story at Slashdot.
Common Low-Calorie Sweetener May Be Riskier For the Heart Than Sugar, Study Suggests
Read more of this story at Slashdot.
Paying To Be Removed From People-Search is 'Largely Ineffective,' Says Study
Read more of this story at Slashdot.
World's Largest 3D-Printed Neighborhood Nears Completion in Texas
Read more of this story at Slashdot.
macOS Sequoia Adds Weekly Permission Prompt For Screenshot and Screen Recording Apps
Read more of this story at Slashdot.
Palantir CTO Urges Pentagon To Prioritize Speed in Defense Spending
Read more of this story at Slashdot.
Video Game Adaptation 'Borderlands' Hits Theaters With Rare 0% on Rotten Tomatoes
Read more of this story at Slashdot.
Nasdaq Has Hundreds of Penny Stocks. Now It's Trying to Purge Them.
Read more of this story at Slashdot.
Home Security Giant ADT Says It Was Hacked
Read more of this story at Slashdot.
ICANN Reserves<nobr> <wbr></nobr>.Internal For Private Use at the DNS Level
Read more of this story at Slashdot.
Mayor Shows Pirated Movie On Town Square Big Screen In Brazil
Read more of this story at Slashdot.
Judge Fines Ripple $125 Million, Bans Future Securities Law Violations
Read more of this story at Slashdot.
After AI, Quantum Computing Eyes Its 'Sputnik' Moment
Read more of this story at Slashdot.
Representative Line: Tern on the Flames
There's nothing inherently wrong with the ternary operator. It's just the kind of thing that gets abused.
Now, we all know how it should be used. We frequently would write something like this:
let val = arr.length>0?arr[0].id:0;If the array contains elements, grab the first one, otherwise use a reasonable default. It's not my favorite convention, but it's fine. Nothing worth complaining about.
Lahar Shah's co-worker has a different approach to this.
// Set value for tempVariable arr.length > 0 ? tempVariable = arr[0].id : tempVariable = null;It's amazing how converting a ternary from an expression which evaluates to a value into a statement which changes program state makes it feel so much grosser. There's nothing technically wrong with this, but it makes me want to set the code on fire and dance naked around the flames.
This, of course, wasn't a one-off use of the ternary operator. This was how the developer used the ternary, forever and always.
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!China Launches Satellites For Major Network To Rival Starlink
Read more of this story at Slashdot.
UK Royal Mint To Extract Gold From E-Waste
Read more of this story at Slashdot.