▲ | galaxyLogic 2 days ago | |||||||
True. And what is an "illegal state" anyway? If two options are "mutually incompatible" it means that they, as far as we know, so far, have never occured at the same time. But that is just how things are currently. The world may change. And it's important to strive for maintainable code that can accommodate such change easily. Expanding company operations to work in a different country is an example of this (our) "world changing". States that never occur together here, may occur together there. Or in the future more generally. So, making illegal states non-representable is about avoiding errors in respect to the system specification. But it does not take into account the fact that in the real world specifications typically evolve and change even during development, and perhaps more so later. | ||||||||
▲ | thfuran 2 days ago | parent [-] | |||||||
So, what, you’d advocate declaring all function parameters and returns as void* to maximize flexibility with respect to future changes in requirements? | ||||||||
|