Computer
Microsoft Says Voice Will Emerge as Primary Input for Next Windows
Read more of this story at Slashdot.
Fintech, Crypto CEOs Urge US President To Block Banks' Data-Access Fees
Read more of this story at Slashdot.
Lenovo's PC Business Surges To 15-Quarter High With AI Models Leading The Charge
Read more of this story at Slashdot.
Co-Founder of xAI Departs the Company
Read more of this story at Slashdot.
Data Brokers Are Hiding Their Opt-Out Pages From Google Search
Read more of this story at Slashdot.
China-Plus-One Was Just China All Along
Read more of this story at Slashdot.
Russia Restricts Calls Via WhatsApp and Telegram
Read more of this story at Slashdot.
CodeSOD: An Array of Parameters
Andreas found this in a rather large, rather ugly production code base.
private static void LogView(object o) { try { ArrayList al = (ArrayList)o; int pageId = (int)al[0]; int userId = (int)al[1]; // ... snipped: Executing a stored procedure that stores the values in the database } catch (Exception) { } }This function accepts an object of any type, except no, it doesn't, it expect that object to be an ArrayList. It then assumes the array list will then store values in a specific order. Note that they're not using a generic ArrayList here, nor could they- it (potentially) needs to hold a mix of types.
What they've done here is replace a parameter list with an ArrayList, giving up compile time type checking for surprising runtime exceptions. And why?
"Well," the culprit explained when Andreas asked about this, "the underlying database may change. And then the function would need to take different parameters. But that could break existing code, so this allows us to add parameters without ever having to change existing code."
"Have you heard of optional arguments?" Andreas asked.
"No, all of our arguments are required. We'll just default the ones that the caller doesn't supply."
And yes, this particular pattern shows up all through the code base. It's "more flexible this way."
.comment { border: none; } [Advertisement] Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.First Antidote For Carbon Monoxide Poisoning 'Cleans' Blood In Minutes
Read more of this story at Slashdot.
How the Unraveling of Two Pentagon Projects May Result In a Costly Do-Over
Read more of this story at Slashdot.
Kodak Warns It May Go Out of Business
Read more of this story at Slashdot.
Google's Gemini AI Will Get More Personalized By Remembering Details Automatically
Read more of this story at Slashdot.
New York Sues Zelle Parent Company, Alleging It Enabled Fraud
Read more of this story at Slashdot.
Pebble Time 2 Reboot Gets a Redesign
Read more of this story at Slashdot.
Polestar Sets Production Car Record For Longest Drive On a Single Charge
Read more of this story at Slashdot.
Apple Plots Expansion Into AI Robots, Home Security and Smart Displays
Read more of this story at Slashdot.
Countrywide Natural Experiment Links Built Environment To Physical Activity
Read more of this story at Slashdot.
Samsung Launches World's First Micro RGB TV
Read more of this story at Slashdot.
Young Americans Push Playback Beyond 1x as Platforms Widen Speed Controls
Read more of this story at Slashdot.
Microsoft Makes Pull Print Generally Available
Read more of this story at Slashdot.