3 ms·
> Constraints provide freedom. (...) This is not Orwellian newspeak. This is just contravariance of function arguments. For every restriction on what the calle
by catnaroek 10y ago
> Constraints provide freedom. (...) This is not Orwellian newspeak.
This is just contravariance of function arguments. For every restriction on what the caller may supply, the callee earns the freedom to assume something about what it is supplied (namely, that the restriction holds). This is mathematically a triviality, of course. From a higher level point of view, the terminology might change, but the same essential fact remains: when a module/class/component/whatever author claims a freedom for themselves, they're denying freedoms to their users. This is inescapable.
The real problem is, if freedom is never absolute, but rather a matter of give and take between different software components, how do we find the right “distribution of freedoms” across software components? This is the essence of modular software design, and it's highly nontrivial.