I can understand how a truly complex system becomes "don't touch it except to add things, you have no idea what depends on that chunk of code"
Thank you!
But even in the feature flag case, it serves a purpose by allowing old code to be removed in 2 stages rather than 1 (divide and conquer).
It means the old code still compiles, just in case it needs to be reinstated in a hurry.
I agree with you, commented out code is not ok, unless it is an example or pseudo code. The rest is trash and has no place in any reasonable codebase. If you want to see what the code was like six months ago, use git.
Line comments, yes, but not for block comments or #if 0 disabled sections -- if your search result comes from the middle of one of those, it does not look like a comment without the context, and can mislead you.
One of the biggest thing that catches me out with commented out code is wondering why it is commented out. Is it desirable, but not working for some reason? Is it undesirable, but not deleted for some reason? Is the new code an experiment? Is the old code an experiment? If it's an experiment, am I sure the previous person reinstated the correct code?
Even if you say it can be reinstated in a hurry, why would it need to be? When I'm reading the code, that's one of the questions I'll be thinking about. If I see commented out code, I'll start walking back in history and seeing why the code was replaced. Then I'll be wondering if there is some work flow that perhaps we need to retain for some reason.
All of this takes time. If you really want the code to be gone, it's better for me if you remove it. Then I don't have to wonder why it is there.
To me that's just a symptom of a system that lacks good test coverage. Being able to remove things that you believe to be unused and seeing if it's safe or not is one of the biggest benefits of test coverage. That and, of course, knowing if your "fix" doesn't break things far away that depend on it.
That said, it appears to me that as soon as we start to tread against entropy we might notice this phenomenon cropping up. Life seems to “collapse” on new designs and human understanding too seems to collapse, but in both cases it seems that only the system complexity collapses, not the entity complexity. I think that the collapse of the complexity of the surrounding system is the result of outside stimulus causing additional entity complexity to be added to the total complexity. In a stable, complex, system this has the potential for massive system destabilization, but it is not certain and it doesn’t seem to be the nature of complex system themselves to inherently collapse on less complex states, rather it is the result of stimulus. Moreover, if we look at total complexity, does it really become less complex or does the complexity just shift from the system to the entity?
IIRC, I think first read the phrase "complexity catastrophe" in the book Design Rules: The Power of Modularity. Per the authors, it's when a system becomes so complex (interdependent) that the cost of any further changes far outweigh the expected benefit.
https://www.amazon.com/Design-Rules-Vol-Power-Modularity/dp/...
At least trend-wise, it’d probably look similiar to a malthusian catastrophe (population reaches environment carrying capacity at time n, and then (greatly) overshoots it at time n+1, resulting in mass die off due to starvation, taking the population well below carrying capacity)
In The Matrix movies that is sort of a key premise of their world setting. There are words like reset, reboot, reload for it.
But I don't think it's a given, not all complex systems are prone to collapse; some systems, once past a given point, may even perpetuate their complexity practically indefinitely.
Consider life on Earth: even if a cataclysm occurs that results in mass extinctions, new life will eventually take over, in millions if not "mere" thousands or hundreds of years.
Until Earth itself no longer exists that is. Same goes for galaxies and the Universe at large.
Countless attempts to improve anything in that ancient code base failed since by that point, every little quirk that browser exposed was depended on by some essential system running a power plant, hospital or internet core infrastructure.
So the archeologists rather try to find even more quirks that can be abused for performance.
The fallout of this means that all 'modern' technology is operated upon by tech-priests, who blindly perform rituals upon equipment to ensure it's 'machine spirit' is satisfied. This ensures that the equipment will properly function. All knowledge as to how the most advanced equipment operates is lost - all that's left is how to produce some of the lesser pieces.
Caches of templates to produce standardised equipment are highly treasured. These ancient and supremely advanced caches produce extremely detailed designs for the entire supply chain required to build a single item. A template to provide for a slightly sharper knife is as desirable to the Imperium as another template to provide for a 55 Meters tall armoured war machine.
Deserves repeating.
At my job, it's repeatedly discussed as a feature to be an engineer who removes the most code. Most engineers are net positive, the few are break even... but the true greats are the ones who're able to go negative.
Pink diffs are the best diffs.
I bet this is true of governments as well, since governments are systems.