It’s very common the analogy between software “factory” and the civil sector: buildings are made brick by brick, a patient and homœopathic work to build a huge and solid structure, while software are made code by code, a patient work too.
Nothing could be futher from reality.
Still inexact, but closer to the real thing, it’s the analogy with a transport vehicle (not its factory!)
A software is like a tractor: when the tires are bald, you change them. If the engine is broken, you fix it, otherwise you change it. When the tractor is obsolete, you change the whole thing.
So are the software.
When some parts are malfunctioning, you change them. If its core is broken, you fix it, otherwise you change it. When the software is overpast, you change the whole thing.
Mind that the code is to the software as the tractor hardware is to its feature. Change the code isn’t change the software.
More precisely, the software is a live thing, that grows, evolves, and eventually dies. It’s information, not a hard brick.
Image credits: pngtree @ Pinterest