Feed aggregator
Global Temperatures Likely To Exceed Key Limit For First Time
Read more of this story at Slashdot.
US Agency Warns Employees About Phone Use Amid Ongoing China Hack
Read more of this story at Slashdot.
Hacker Says They Banned 'Thousands' of Call of Duty Gamers By Abusing Anti-Cheat Flaw
Read more of this story at Slashdot.
'Just Have AI Build an App For That'
Read more of this story at Slashdot.
What Tired Texans Wrote To the FCC
Read more of this story at Slashdot.
Plastic Pollution is Changing Entire Earth System, Scientists Find
Read more of this story at Slashdot.
Malwarebytes Acquires AzireVPN
Read more of this story at Slashdot.
Sega Delisting Over 60 Classic Games From Virtual Stores
Read more of this story at Slashdot.
Nvidia Sets 100-Hour Monthly Cap on Cloud Gaming Service
Read more of this story at Slashdot.
Taiwan Must Improve Its Chip Tech to Stay Ahead, TSMC's Hou Says
Read more of this story at Slashdot.
The Other Election Night Winner: Perplexity
Read more of this story at Slashdot.
DataBreach.com Emerges As Alternative To HaveIBeenPwned
Read more of this story at Slashdot.
Sysadmin Shock As Windows Server 2025 Installs Itself After Update Labeling Error
Read more of this story at Slashdot.
Nearly Three Years Since Launch, Webb Is a Hit Among Astronomers
Read more of this story at Slashdot.
Representative Line: One More Parameter, Bro
Matt needed to add a new field to a form. This simple task was made complicated by the method used to save changes back to the database. Let's see if you can spot what the challenge was:
public int saveQualif(String docClass, String transcomId, String cptyCod, String tradeId, String originalDealId, String codeEvent, String multiDeal, String foNumber, String codeInstrfamily, String terminationDate, String premiumAmount, String premiumCurrency, String notionalAmount, String codeCurrency, String notionalAmount2, String codeCurrency2, String fixedRate, String payout, String maType, String maDate, String isdaZoneCode, String tradeDate, String externalReference, String entityCode, String investigationFileReference, String investigationFileStartDate, String productType, String effectiveDate, String expiryDate, String paymentDate, String settInstrucTyp, String opDirection, String pdfPassword, String extlSysCod, String extlDeaId, String agrDt) throws TechnicalException, DfExceptionThat's 36 parameters right there. This function, internally, creates a data access object which takes just as many parameters in its constructor, and then does a check: if a field is non-null, it updates that field in the database, otherwise it doesn't.
Of course, every single one of those parameters is stringly typed, which makes it super fun. Tracking premiumAmount and terminationDate as strings is certainly never going to lead to problems. I especially like the pdfPassword being stored, which is clearly just the low-security password meant to be used for encrypting a transaction statement or similar: "the last 4 digits of your SSN" or whatever. So I guess it's okay that it's being stored in the clear in the database, but also I still hate it. Do better!
In any case, this function was called twice. Once from the form that Matt was editing, where every parameter was filled in. The second time, it was called like this:
int nbUpdates = incoming.saveQualif(docClass, null, null, null, null, null, multiDeal, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);As tempted as Matt was to fix this method and break it up into multiple calls or change the parameters to a set of classes or anything better, he was too concerned about breaking something and spending a lot of time on something which was meant to be a small, fast task. So like everyone who'd come before him, he just slapped in another parameter, tested it, and called it a day.
Refactoring is a problem for tomorrow's developer.
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!Australia Proposes Ban On Social Media For Those Under 16
Read more of this story at Slashdot.
Intel Sued Over Raptor Lake Voltage Instability
Read more of this story at Slashdot.
Canada Bans TikTok Citing National Security Concerns
Read more of this story at Slashdot.
OpenAI Acquires Chat.com
Read more of this story at Slashdot.
Anthropic's Haiku 3.5 Surprises Experts With an 'Intelligence' Price Increase
Read more of this story at Slashdot.