Feed aggregator
Indonesia Bans Search Engine DuckDuckGo On Gambling, Pornography Concerns
Read more of this story at Slashdot.
Google Loses DOJ Antitrust Suit Over Search
Read more of this story at Slashdot.
Design Flaw Has Microsoft Authenticator Overwriting MFA Accounts, Locking Users Out
Read more of this story at Slashdot.
Illinois Governor Approves Business-Friendly Overhaul of Biometric Privacy Law
Read more of this story at Slashdot.
Every Microsoft Employee Is Now Being Judged on Their Security Work
Read more of this story at Slashdot.
Nvidia Allegedly Scraped YouTube, Netflix Videos for AI Training Data
Read more of this story at Slashdot.
Elon Musk Revives Lawsuit Against OpenAI and Sam Altman
Read more of this story at Slashdot.
CrowdStrike To Delta: Stop Pointing the Finger at Us
Read more of this story at Slashdot.
Schwab, Fidelity Traders Report Outages During Stock Meltdown
Read more of this story at Slashdot.
OpenAI Grapples With Unreleased AI Detection Tool Amid Cheating Concerns
Read more of this story at Slashdot.
Are EV 'Charger Hogs' Ruining the EV Experience?
Read more of this story at Slashdot.
Founder of Collapsed Social Media Site 'IRL' Charged With Fraud Over Faked Users
Read more of this story at Slashdot.
CodeSOD: Catch or Else
Today's anonymous submitter asks a question: "How do you imagine the rest of the codebase to be like?"
Well, let's look at this snippet of TypeScript and think about it:
.catch((): void => { this.loadFromServerAndShowMessage(); }); } else { this.loadFromServerAndShowMessage(); } }) .catch((): void => { this.loadFromServerAndShowMessage(); }); } else { this.loadFromServer(); } }From the .catchs, I can tell that we're looking at a series of nested promises, each loading content based on the results of the previous. The requests may fail in two ways- either through an exception (hence the catch calls), or because it doesn't return useful data in some fashion (the else clauses).
Regardless of how it fails, we will loadFromServerAndShowMessage, which implies that we're not expecting to handle failures based on connectivity. That seems like a mistake- if our promise fails for some reason, it's likely because we don't have connectivity, so loadFromServer doesn't seem like a viable operation. Maybe we should look at the exception?
Nah, we don't need to do that.
How do I imagine the rest of the code base? Well, I imagine it as a messy thicket of dependencies and no real modularity, fragile and confusing, and probably riddled with bugs, many of which are difficult or impossible to replicate in a controlled environment, meaning they'll likely never get fixed.
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!DARPA Wants to Automatically Transpile C Code Into Rust - Using AI
Read more of this story at Slashdot.
Whatever Happened to MySpace?
Read more of this story at Slashdot.
Neuralink Has Successfully Implanted a Second Brain Chip, Musk Says
Read more of this story at Slashdot.
Rust-Written 'Redox OS' Now Has a Working Web Server
Read more of this story at Slashdot.
Is the 'Kids Online Safety Act' Losing Momentum?
Read more of this story at Slashdot.
What's the 'Smartest' City in America - Based on Tech Jobs, Connectivity, and Sustainability?
Read more of this story at Slashdot.
Revolutionary Dual Action Antibiotic Makes Bacterial Resistance Nearly Impossible
Read more of this story at Slashdot.