Israel's FA accuse Ireland manager of 'ignorance, hypocrisy and stupidity' after he commented 'we're playing against genocide' before match which critics want cancelled over Gaza
Aryna Sabalenka escapes her meltdown after US Open final defeat with Greek holiday alongside fiance Georgios Frangulis
Move over, Pavarotti! World's only singing lemur opens its mouth wider on higher notes - just like a trained soprano
Trump ruthlessly mocked as media ban spectacularly backfires at White House ribbon cutting ceremony
Could eating wheatgerm supercharge your flu jab?
M25 traffic at STANDSTILL with drivers facing long delays
Dolly Parton's nephew who delivered heartbreaking announcement of singer's death is FIRED from longtime security role amid estate war
Girls are better at paying attention from BIRTH! Study finds newborn girls can focus for longer than boys
Presley Gerber, 27, died from suspected overdose as new information emerges about LA rehab star spent his final days in
Nadiya Hussain shares video accusing Ed Sheeran of shedding 'white tears' after he broke down on stage saying his family had 'abandoned him' while addressing Israel-Palestine row
Luxury camp to open on the world's largest salt flat - with Bolivian blue marble interiors and surrounded by 12,000sqkm of silver-white wilderness
Rosie Huntington-Whiteley wows in a sexy leather trench coat as she joins leggy Lila Moss and Jodie-Turner Smith at London Fashion Week's star-studded Burberry show
CodeSOD: The John Cage Variable
David C sends us a true confession.
For my job, I write C++ code as if it was a scripting language (long story) to produce programmatic animations for videos. Given that these are "write-and-run-once-and-never-look-at-it-again" programs, I tend to not try as hard to make my code good. But once I wrote this line of code, I had to take a step back and reevaluate my life choices.
fade_out(scene, length4->range(0, 3), length4_3_3, length4[4], length4[5]->range(0, 3));This is a natural consequence of passing parameters as arrays, it seems; instead of having meaningful named values in a struct or similar, we have all these things packed into arrays. We can see a long ago attempt at using variable, badly, in the John Cage variable: length4_3_3. John Cage's (in)famous composition, "4:33" calls into question what precisely even is music, just like this variable calls into question what even is a variable name- because this is clearly a range expression of size 1. length4->range(3,1), or more reasonably, probably length4[3].
Where a normal variable name might give us some indication about what its contents mean, this gives us none of that, just a statement of how we could acquire those contents if we ever wanted them again.
For disposable code, this is hardly the worst thing I've ever seen, but is any code truly disposable? You always find yourself wanting to pull some piece of it forward into the next project, inevitably. Read the third chapter of Structure and Interpretation of Computer Programs and consider yourself absolved. Go forth and sin no more.