Supermarket giant Tesco sues VMware, warns lack of support could disrupt food supply
UK supermarket giant Tesco has sued Broadcom for breach of contracts pertaining to its VMware licenses, named Computacenter as a co-defendant, and warned it may not be able to put food on the shelves if the situation goes pear-shaped.…
Princess Andre pleads with trolls to 'stop spreading negativity about her family' after staying firmly neutral on feud between her parents Peter Andre and Katie Price
Former F1 driver Daniel Ricciardo is selling his barely-used Aston Martin hypercar at auction - and it could go for £2.5MILLION
Rachel Stevens SPLITS from Dancing On Ice boyfriend Brendyn Hatfield after three years of dating
Genius whose life was cancelled: The vicious campaign that robbed TV mastermind Graham Linehan of his career, his celebrity friends and marriage
Susannah Jowitt: What it feels like being the only fat woman left among my friends - thanks to weight-loss jabs in this Shrinking Girl Summer!
GP who was burned out by the NHS and felt 'shafted' by rising household bills reveals why he sold everything he owns to live in a van
World's Biggest Iceberg Breaks Up After 40 Years
Read more of this story at Slashdot.
BBC Radio 2 In The Park bans popular items for festival goers as strict rules confirmed
Home organiser transforms grubby concrete shed into chic laundry room on a £50 budget
Melania 'spotted' at hospital amid rumors around Trump's health
Woman left furious after opening her bag of Walkers Ready Salted only to find EIGHT crisps
Furious Jack Osbourne says 'f**k you' to Pink Floyd's Roger Waters in online rant after he made scathing comments about late rock legend Ozzy Osbourne following his death
The OTHER man who's been 'putting a smile' on Olivia Attwood's face: As I'm told her marriage to footballer Brad Dack has 'its ups and downs', my spies couldn't wait to call and tell me everything about this boyband star: KATIE HIND
Former Southend mayor claims he has been banned from prestigious hotel
Toddler goes missing from Sydney childcare centre for HOURS after grandfather's grave error
CodeSOD: Adding to the Argument
David G saw a pull request with a surprisingly long thread of comments on it. What was weirder was that the associated ticket was all about adding a single parameter to an existing method. What could be generating that much discussion?
How could adding an argument add to an argument?
registerFooWrapper: function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { bar.when('bar-event', function(context) { context.foo({ arg1: arg1, arg2: arg2, arg3: arg3, arg4: arg4, arg5: arg5, arg6: arg6, arg7: arg7, }); }); }This is the original version of the JavaScript function. The parameter names have been anonymized. That aside, this still isn't very good. Seven parameters is likely too many, and based on what I see in setting the context, there is an object type that holds them all, so maybe we should be passing the object around in the first place? Still, this isn't a WTF by any stretch, and since it's already deployed code, changing the interface significantly is a bad idea- maybe just adding a parameter is the right choice here. So what generated so much discussion?
This revision:
registerFooWrapper: function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, notArg8) { if (notArg8 === true) { bar.when('bar-event', function(context) { context.foo({ arg1: arg1, arg2: arg2, arg3: arg3, arg4: arg4, arg5: arg5, arg6: arg6, arg7: arg7, arg8: !notArg8, }); }); } else { bar.when('bar-event', function(context) { context.foo({ arg1: arg1, arg2: arg2, arg3: arg3, arg4: arg4, arg5: arg5, arg6: arg6, arg7: arg7 }); }); } }Okay, so if notArg8 is true, we pass false to the context. If it's any other value, we don't past arg8 at all. I do not understand what I'm looking at here. If the goal is to ensure that arg8 is either true or not set, there are clearer ways to express that idea. But also, the goal of the ticket was not to do that- it was simply to add another parameter, which means you could drop the condition entirely and just add the parameter. context was already receiving arg8 as undefined, so it could clearly handle an undefined value.
David made some comments on the pull request, but the original developer just ended up going radio silent on it. One of the juniors on David's team approved it, for some reason, but nobody ever actually hit merge. Instead, a different developer simply made a version that took arg8 as a parameter, passed it down to context, and called it a day. It worked, the tests passed, and everyone was happy.
Well, except the original developer, but again, who knows what they were trying to do?