pr

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, DfException

That'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!




pr

Representative Line: How is an Array like a Banana?

Some time ago, poor Keith found himself working on an antique Classic ASP codebase. Classic ASP uses VBScript, which is like VisualBasic 6.0, but worse in most ways. That's not to say that VBScript code is automatically bad, but the language certainly doesn't help you write clean code.

In any case, the previous developer needed to make an 8 element array to store some data. Traditionally, in VBScript, you might declare it like so:

Dim params(8)

That's the easy, obvious way a normal developer might do it.

Keith's co-worker did this instead:

Dim params : params = Split(",,,,,,,", ",")

Yes, this creates an array using the Split function on a string of only commas. 7, to be exact. Which, when split, creates 8 empty substrings.

We make fun of stringly typed data a lot here, but this is an entirely new level of stringly typed initialization.

We can only hope that this code has finally been retired, but given that it was still in use well past the end-of-life for Classic ASP, it may continue to lurk out there, waiting for another hapless developer to stumble into its grasp.

[Advertisement] Plan Your .NET 9 Migration with Confidence
Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!






pr

Preserved tracks suggest non-avian dinosaurs used their wings to run

Not all winged dinosaurs were necessarily capable of full flight, but this anatomical feature may have enabled them to travel further by flapping or gliding




pr

Amateur sleuth finds largest known prime number with 41 million digits

The largest prime number is now 16 million digits longer than the previous record found in 2018, thanks to an amateur hunter and his large collection of high-power graphics cards




pr

Meta AI tackles maths problems that stumped humans for over a century

A type of mathematical problem that was previously impossible to solve can now be successfully analysed with artificial intelligence




pr

This surprisingly creative trick helps children eat more fruit and veg

Weaving tales of magical fruit and vegetables into your children's stories may encourage them to eat healthy snacks




pr

Meditation seems to improve our empathy for strangers

In a small study, women experienced more empathy for strangers who were experiencing pain after an eight-week meditation training programme




pr

Flu viruses have evolved proteins that let them break through mucus

Computer simulations of how influenza A moves through human mucus found it is ideally configured to slide through the sticky stuff on its way to infecting cells




pr

AI helps driverless cars predict how unseen pedestrians may move

A specialised algorithm could help autonomous vehicles track hidden objects, such as a pedestrian, a bicycle or another vehicle concealed behind a parked car




pr

Simple fix could make US census more accurate but just as private

The US Census Bureau processes data before publishing it in order to keep personal information private – but a new approach could maintain the same privacy while improving accuracy




pr

The COP16 biodiversity summit was a big flop for protecting nature

Although the COP16 summit in Colombia ended with some important agreements, countries still aren’t moving fast enough to stem biodiversity loss




pr

Spraying rice with sunscreen particles during heatwaves boosts growth

Zinc nanoparticles, a common sunscreen ingredient, can make plants more resilient to climate change – in a surprising way




pr

3D printing with light and sound could let us copy human organs

One day, doctors might be able to 3D print copies of your organs in order to test a variety of drugs, thanks to a new technique that uses light and sound for rapid printing




pr

Distant dwarf planet Makemake might have a surprising ice volcano

A small world in the outer solar system appears to have volcanic activity possibly spurred by liquid water




pr

Carbon emissions from private jets have exploded in recent years

The climate impact of flights taken by the super-rich rose sharply from 2019 to 2023, fuelling calls for a carbon tax on private aviation




pr

We are a long way from pregnancy being safe on Mars

Dangerous radiation reaches Mars at levels we aren't exposed to on Earth, which makes the Red Planet a particularly dangerous place to be during pregnancy




pr

Watch elephants use a hose to shower themselves – and prank others

Asian elephants at Berlin Zoo show impressive skill when using a hose as a tool, and even appear to sabotage each other by stopping the flow of water




pr

Not impressed with nature !





pr

24 SuPURRemely Expressive Cat Memes Mirroring the Hooman Experience From the Feline Pawspective

Cats aren't so different from us. When it's cold outside and we want to avoid responsibilities, we seek our coziest nap spot. When we're hungry at 2 AM, we bother someone for a snack. And when we're pawsitively peeved with the world, it's off to our favorite cat tower to stare down at the peasants below. 

Hooman cat lovers have a funny way of mirroring our experiences with our cats. If you're anything like me, a theatrical cat owner, you know that each cat you encounter has a different voice, different mannerisms, and a totally different pawsonality based on their sass levels. It's only natural to project our fancies on our felines because they're not only our best buds but our purrtner in crime! So if you love your kitty and miss them every day while you're out running errands, working (ew), or socializing with friends, remember that they're silently judging you from afar, waiting for their favorite bald, bipedal giant to come pop open a new can of wet food for them. You are so cherished!

 Pawsitive Vibes: Subscribe to our weekly newsletter for the purrfect Caturday treat!




pr

1-year-old siamese cat refuses to use the bathroom unless human accompanies him to the litter box, fed up feline owner seeks solutions: 'My cat demands bathroom reciprocity'

Cats are truly unique creatures. Much like us humans, each one has their own completely developed personality and quirks. Some cats are perpetual balls of energy, pausing from their mischief only to engage in a well deserved cat nap. Some cats are totally indifferent to your existence, you could provide them with treats, pets, the whole lot and still not receive much attention in return. And some cats need their favorite human to accompany them to the litter box any time they need to take care of business. The cat featured in the story we are covering today is the latter, and might we add, a total goofball. 

To be honest, this is a new one for us. We have yet to come across a cat who demands that their human be present during all bathroom activities. We've heard of cats who like to go to the bathroom while their humans are in the bathroom, to protect them from whatever evil lies dormant in the toilet, but yeah, this is a new one. What advice would you give to the original poster? All we can think of is to laugh and cry at the same time. 




pr

Aquaplus Unveils To Heart Remake's Spring 2025 Launch, Project Kizuna RPG

To Heart remake slated for Switch, PC with full-3D graphics




pr

Bleach: Rebirth of Souls Game's Character Trailer Previews Nel

3D arena fighting game slated for PS5, PS4, Xbox Series X|S, PC in early 2025




pr

K Manga Adds 'I Don't Want to Be Killed By You, My Crown Prince!', My Reveal Skill is OP! -Taking from Legendary Heroes to Become the Strongest Manga

Also: The Great Queen Victoria Winner Ostwen Has Arrived! launches in English




pr

WildBrain's Family Channel Airs Pretty Guardian Sailor Moon Crystal Anime in Canada

Anime airs Mondays through Thursdays at 7:30 p.m. EST




pr

Witchy Precure!!: MIRAI DAYS Anime's Trailer Previews Opening Song, Saori Hayami's 2nd Role

Saori Hayami plays mysterious girl Hisui, performs ending song 'Kisekiralink' with Rie Takahashi, Yui Horie




pr

Attack on Titan Anime Gets Orchestral Concert World Tour in April-November 2025

13 venues in N. America, 8 venues in Europe, 1 venue each in Singapore, Australia




pr

I Left My A-Rank Party Anime's Promo Video Reveals More Cast & Staff, January 11 Debut

Yoshiki Nakajima, M.A.O, Yoshino Nanjō, more join cast




pr

Graphix to Release Yoshnio Koyoka's Mecha-Ude: Mechanical Arms Manga in Print in April

First volume of manga adaptation ships on April 15




pr

Live-Action It Takes More than a Pretty Face to Fall in Love Film's Teaser Reveals Cast, Staff, March 7 Debut

Ryubi Miyase, Rinka Kumada star in film directed by Liar x Liar's Saiji Yakumo





pr

Congress Moves to Expand Executive Power Over Nonprofits

The U.S. House of Representatives seems to be moving forward with H.R. 6408, a bill that grants the Treasury Department new powers to revoke nonprofits' tax-exempt status if deemed to support terrorism, raising concerns about potential misuse to target political opponents. Critics warn of risks to civil liberties and charitable organizations.

Continue reading Congress Moves to Expand Executive Power Over Nonprofits at The Wild Hunt.




pr

The End of Ondsel and Reflecting on the Commercial Prospects for FreeCAD

Within the world of CAD there are the well-known and more niche big commercial players and there are projects like FreeCAD that seek to bring a OSS solution to the …read more




pr

Convention Programming

In the most general terms, my approach to writing is to write the book I want to read, and hope other people want to read it too. I take the same approach when I’m in charge of programming at a convention—that is, I try to put together panels built around writing topics that I’m struggling … Continue reading Convention Programming




pr

“We live in a democracy, therefore the government represents us.”

(I’ll be adding this to my socialism FAQ, but for now I think it deserves it’s own post.) The logic here is what fascinates—the mechanical formality, starting with rigid definitions and proceeding step by careful step to absurdity. The old scholastics of the middle ages would certainly have approved, but if we don’t want to … Continue reading “We live in a democracy, therefore the government represents us.”




pr

A Brief Note on the Power and Limits of Propaganda

The 1872 presidential election (Ulysses Grant vs Horace Greeley) represented the last time progressive change was  brought about through a national election. Since then, progressive change has either been forced by mass action (Women’s suffrage, Welfare, Social Security, Unemployment insurance, Civil Rights, Gay rights, &c) or been a small part of a bill the bulk … Continue reading A Brief Note on the Power and Limits of Propaganda




pr

Live Blogging the first Presidential debate

7:51: Right wingers are already saying that Biden 1) already knows all the questions and 2) is taking drugs. There are, to my knowledge, no performance enhancing drugs for mental awareness, and *I* know what the questions will be. 7:52: I’m still convinced that Trump will ignore the social distancing rule and immediately come over




pr

Final Presidential debate

8;18: Currently watching “Supernatural.” Feeling very relaxed. That’s gonna change. 8:59; Please don’t let Biden screw up. 9:03: So I wonder how long it will be before Trump tries shouting over Biden’s mic. 9:05: Oh yeah. I’m sure Trump will let Biden speak. 9:05: And literally the first sentence out of his mouth is a




pr

Anh Is The Problematic Friend

who even invited her




pr

the prevailing wisdom

Today on Toothpaste For Dinner: the prevailing wisdom


This RSS feed is brought to you by Drew and Natalie's podcast Garbage Brain University. Our new series Everything Is Real explores the world of cryptids, aliens, quantum physics, the occult, and more. If you use this RSS feed, please consider supporting us by becoming a patron. Patronage includes membership to our private Discord server and other bonus material non-patrons never see!




pr

the problem with poor people

Today on Toothpaste For Dinner: the problem with poor people


This RSS feed is brought to you by Drew and Natalie's podcast Garbage Brain University. Our new series Everything Is Real explores the world of cryptids, aliens, quantum physics, the occult, and more. If you use this RSS feed, please consider supporting us by becoming a patron. Patronage includes membership to our private Discord server and other bonus material non-patrons never see!




pr

ill probably be normal

Today on Toothpaste For Dinner: ill probably be normal


This RSS feed is brought to you by Drew and Natalie's podcast Garbage Brain University. Our new series Everything Is Real explores the world of cryptids, aliens, quantum physics, the occult, and more. If you use this RSS feed, please consider supporting us by becoming a patron. Patronage includes membership to our private Discord server and other bonus material non-patrons never see!







pr

#1551; Spring Forth, My Creation (Part 3)

This storyline began with Part 1.




pr

20 In-Law Memes To Help Prepare You for the Holiday Season

Let's face it: Some of us are blessed with really sweet, endearing in-laws, and the rest are faced with parents-in-law who seem to possess a likeness of an underworld ruler. There is simply no in-between. Whether you said something they disagreed with and have written you off as a lost cause or they are simply entitled individuals who care more about their happiness rather than their child's, in-law qualms are more common than not.

To ring in the holiday season, we thought what better way to get festive than to prepare folks for the hectic and chaotic scenes they enter every year during November and December. Though you can't change who your in-laws are, there's no shame in poking fun at your sticky situation. You can love your partner to the ends of the earth and it still wouldn't be enough to combat some families. Know that you've done your best, and your best bet is to take a sip of a yummy drink and watch the fire from the couch this Thanksgiving. Sit this one out, folks! Scroll below.




pr

'It was nonsense': Entitled employee constantly takes credit for other's work, coworker gets revenge by making a fake presentation for her to present in front of boss

There's always that one coworker who knows how to get away with taking credit for everyone else's hard work. You put in the effort, lose sleep over the details, and then they swoop in, ready to present it all like they thought of it themselves. This exact situation happened in one office until one clever employee decided to turn the tables. After watching his entitled coworker repeatedly swipe his projects and pass them off as her own, he put together a presentation just for her. Packed with confusing data points and meaningless buzzwords, the presentation was just convincing enough to look important…until you actually tried to explain it. And sure enough, the coworker snagged it and confidently presented it in front of their boss. The employee watched with quiet satisfaction as she stumbled through, each buzzword making less sense than the last. When the boss turned to him for clarification, he threw her under the bus, telling the boss she had no idea what she was talking about. Sweet, sweet office justice.