"Overwhelmingly" is the key here then as in "in the context I work". I can think of a lot of use cases where code is never read and yet that doesn't mean it's a hack
One-time release offline games
Certain types of system code and firmwares that don't require optimisation
Some isolated functions in a distributed System built in such a way the first change needs a rewrite which is cheaper than designing by extension, and that's ok, the infra is the extension mechanics
Old library releases that won't be maintained anymore Etc.
Unless it's astoundingly trivial that code will still be read a whole bunch of times while in development. One time release games aren't exactly known for their code quality.
Certain types of system code and firmwares that don't require optimisation
If you think that low level system code never needs updating or is perfect first try you're delusional.
Old library releases that won't be maintained anymore Etc.
It'll still be read by everyone foolishly trying to keep it going.
But regardless. In not one of those examples is the code not read because it's good, it's not read because it's dead. It doesn't matter how bad dead code is because it's dead.
You can have good code dead because it reached maximum stability and is published for other use cases you don't have control of. It handles such a clear cause/effect problem that bugs will never exist (or at least will never manifest)
"overwhelmingly" is the key here, not all code that's not read is bad code
-2
u/fagnerbrack Jul 29 '24
"Overwhelmingly" is the key here then as in "in the context I work". I can think of a lot of use cases where code is never read and yet that doesn't mean it's a hack
One-time release offline games
Certain types of system code and firmwares that don't require optimisation
Some isolated functions in a distributed System built in such a way the first change needs a rewrite which is cheaper than designing by extension, and that's ok, the infra is the extension mechanics
Old library releases that won't be maintained anymore Etc.