Skip to main content

CodeSOD: Safegaurd Your Comments

2 months 1 week ago

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; } [Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more.
Remy Porter

Threat intelligence supply chain is full of weak links, researchers find

2 months 1 week ago
And they're being stressed by geopolitical concerns that threaten to slow important data-sharing efforts

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.…

Simon Sharwood

The US Had a Big Battery Boom Last Year

2 months 1 week ago
The United States installed a record 57 gigawatt hours of new battery storage on its electric grids in 2025, a nearly 30% increase over the prior year that arrived even as the Trump administration cut tax credits for wind and solar in last summer's One Big Beautiful Bill. The figures come from a Solar Energy Industries Association report published Monday, which also projects the market will grow another 21% this year by adding 70 gigawatt hours in 2026 alone. Battery tax credits themselves survived the legislation largely intact, and the majority of last year's new installations were stand-alone systems not tied to specific solar projects. In Texas, solar met more than 15% of electricity demand throughout the summer and beat out coal for the first time, and the SEIA report predicts the state will overtake California this year in total deployed storage. Supply chain restrictions reinforced by the bill and project cancellations could slow the pipeline this year, the report cautions.

Read more of this story at Slashdot.

msmash