David Beckham cheers on Spain in the World Cup semi-final after his four-year spell in Madrid as he's joined by his wife Victoria and their family after THAT instant meme reaction
Fire the size of 25 football pitches engulfs Essex field
I put my insomnia down to drinking and perimenopause. Then a scan revealed my LIVER could be to blame... and it affects more women than you think. Here's how to find out if you have it too: GEORGINA FULLER
The Star Wars cantina scene shows we need a new hope for the agentic web
Helen Flanagan shares a tearful selfie as she opens up about casual sex and 'intense rejection'
Incredible moment pack of dogs rescue women from pervert who tried to sexually assault them in Melbourne
House Votes For Permanent Daylight Saving Time
Read more of this story at Slashdot.
Fresh poll finds £5million gift could be 'widely damaging' for Nigel Farage
Traveller land-grab leads to 'three months of sheer hell' with villagers struggling to sell their £600,000 homes
Anne Hathaway breaks silence on surprise 'buzzer beater' pregnancy at 43: 'We were shocked it worked'
Does Katie Holmes have a toyboy? Tom Cruise's ex, 47, holds hands with hunky artist nearly 10 years her junior in the Hamptons
World Cup Breakfast: The Spain star who has NEVER LOST in his 49 caps, the figure who may be more unpopular than Gianni Infantino in Dallas, match highlights - and what to look out for today as England face Argentina
Police probe is launched into ex-Labour candidate who said she hoped 'murdered' Ann Widdecombe suffered an 'extremely painful death'
CodeSOD: The Error Check
Today's submission is less a WTF and more a, "Yeah, that'd annoy me too."
Stevie works in a code-base that's largely C, which means function return values are usually used to communicate to status codes. The standard:
BOOL success = someFunc(); if (!success) {// handle the errorIf someFunc returns TRUE, we succeeded, otherwise we failed.
There's nothing wrong with that convention. But there is something wrong with one of the long-time developers on the project, because they have their own idiom for doing this. And they've been around long enough that their approach is the convention other developers follow. It's not wrong, per se, just confusing:
BOOL error = someFunc(); if (error == FALSE) { //handle the error errorCode = GetLastError(); //… }Yes, pretty much anywhere an error can happen, they check if error == FALSE, and if that's true, they have an error.
I'd say, "at least they're consistent", but they're not. It's the convention, sure, but nobody wrote this down as the convention. New developers come in all the time, and they start out writing code in a more "normal" pattern. But the existing code has its pattern, and there is a lot of it. It has a mass and an inertia that is stronger than any developer. They don't change the code, the code changes them.