Olivia Colman shocks with her choice of crumpet topping as she is the latest Hollywood star to appear in a Warburtons advert
After 53 Years, a Failed Soviet Venus Spacecraft Is Crashing Back to Earth
Read more of this story at Slashdot.
Jennifer Garner appears to make thinly-veiled dig at Blake Lively in resurfaced clip
CodeSOD: Find the First Function to Cut
Sebastian is now maintaining a huge framework which, in his words, "could easily be reduced in size by 50%", especially because many of the methods in it are reinvented wheels that are already provided by .NET and specifically LINQ.
For example, if you want the first item in a collection, LINQ lets you call First() or FirstOrDefault() on any collection. The latter option makes handling empty collections easier. But someone decided to reinvent that wheel, and like so many reinvented wheels, it's worse.
public static LoggingRule FindFirst (this IEnumerable<LoggingRule> rules, Func<LoggingRule, bool> predicate) { foreach (LoggingRule rule in rules) { return rule; } return null; }This function takes a list of logging rules and a function to filter the logging rules, starts a for loop to iterate over the list, and then simply returns the first element in the list, thus exiting the for loop. If the loop doesn't contain any elements, we return null.
From the signature, I'd expect this function to do filtering, but it clearly doesn't. It just returns the first element, period. And again, there's already a built-in function for that. I don't know why this is exists, but I especially dislike that it's so misleading.
There's only one positive to say about this: if you did want to reduce the size of the framework by 50%, it's easy to see where I'd start.
This £45 floral M&S dress could easily pass for Kate Middleton's designer favourite - and it's about to sell out
Revealed: The most scandalous Royal love triangle that had a king's brother in love with a married woman
Friends accused of felling Sycamore Gap tree 'kept a wedge of trunk as a trophy' and exchanged messages 'revelling' in their infamy, court hears
Harrowing new detail in Gene Hackman wife's autopsy revealed after she was killed by rat-borne virus
Kerry Washington, 48, flashes her underwear in racy sheer frock after angering Desperate Housewives fans
Chinese carmaker Chery using DeepSeek-driven humanoid robots as showroom sales staff
Chinese carmaker Chery has started using its own humanoid robots as sales staff in its showrooms.…
The Plot to Kill Holly Willoughby: Channel 5 documentary to lift the lid on Essex man Gavin Plumb's obsession with ITV presenter
'Toxic' boss sparks feud after noticing his WFH employee was 'offline' all day: 'Are you lying to me?'
Campaign launched to protect vulnerable beach-nesting birds across Essex
Everything you need to know for world-famous Maldon Mud Race this weekend
Campaign launched to protect vulnerable beach-nesting birds across Essex
Nando's applies to make changes to restaurant building in Braintree
Major Chelmsford roads to be shut for resurfacing works for over a week later this month
Bridget Fonda seen with husband Danny Elfman for first time in years as she shows off dramatic weight loss
Supermicro warns of massive revenue miss as buyers pause purchasing plans
Supermicro shares slumped 15 percent in after-hours trading as the company warned next week’s quarterly results will see it miss forecast revenue by up to $1.5 billion.…
Chemical In Plastics Linked To 350,000 Heart Disease Deaths
Read more of this story at Slashdot.