Democrat lawmaker is THROWN OUT of Trump's State of the Union
Justice Amy Coney Barrett's face says it all as Trump awkwardly blasts SCOTUS to their faces after very frosty welcome
Trump reveals seven 'secret words' Iran must utter or else face relentless war
Lily goes lightly into role she was born for: Emily In Paris star to play Audrey Hepburn in film about making of Breakfast At Tiffany's
It wasn't just the N-word, I also called BAFTAs host Alan Cumming a 'paedophile', says I Swear's John Davidson as he admits he felt a 'wave of shame' before leaving ceremony over his Tourette's tics
Nationwide customers should put £500 into one of these accounts NOW to qualify for any Fairer Share bonus this year
Cracking the Zodiac killer's last unsolved cipher Z32... and a stunning link to the Black Dahlia's gravesite
The Squad look ready to CRY and have their heckling drowned out by chants of U-S-A at Trump's State of the Union
Hockey legend who is dating Sarah Palin gets devastating cancer diagnosis
CodeSOD: Safegaurd Your Comments
I've had the misfortune of working in places which did source-control via comments. Like one place which required that, with each section of code changed, you needed to add a comment with your name, the ticket number, and the reason the change was made. You know, the kind of thing you can just get from your source control service.
In their defense, that policy was invented for mainframe developers and then extended to everyone else, and their source control system was in Visual Source Safe. VSS was a) terrible, and b) a perennial destroyer of history, so maybe they weren't entirely wrong and VSS was the real WTF. I still hated it.
In any case, Alice's team uses more modern source control than that, which is why she's able to explain to us the story of this function:
public function calculateMassGrossPay(array $employees, Payroll $payroll): array { // it shouldn't enter here, but if it does by any change, do nth return []; }Once upon a time, this function actually contained logic, a big pile of fairly complicated logic. Eventually, a different method was created which streamlined the functionality, but had a different signature and logic. All the callers were updated to use that method instead- by commenting out the line which called this one. This function had a comment added to the top: // it shouldn't enter here.
Then, the body of this function got commented out, and the return was turned into an empty array. The comment was expanded to what you see above. Then, eventually, the commented-out callers were all deleted. Years after that, the commented out body of this function was also deleted, leaving behind the skeleton you see here.
This function is not referenced anywhere else, not even in a comment. It's truly impossible for code to "enter here".
Alice writes: "Version control by commented out code does not work very well."
Indeed, it does not.
.comment { border: none; }1,340 home development could cause 'significant increase' in traffic
Threat intelligence supply chain is full of weak links, researchers find
Researchers from Georgia Tech have found that the supply chain for threat intelligence data is susceptible to adversarial action, and proposed a method to improve data sharing that they think will make it stronger.…