https://chicagounbound.uchicago.edu/cgi/viewcontent.cgi?arti...
"The pretense is that the law is a system of known rules applied by a judge; the pretense has long been under attack. In an important sense legal rules are never clear, and, if a rule had to be clear before it could be imposed, society would be impossible. The mechanism accepts the differences of view and ambiguities of words. It provides for the participation of the community in resolving the ambiguity by providing a forum for the discussion of policy in the gap of ambiguity. On serious controversial questions, it makes it possible to take the first step in the direction of what otherwise would be forbidden ends. The mechanism is indispensable to peace in a community."
I've thought a lot about this because it directly impacts whether you could turn a contract into code. Code is for the most part very deterministic - you can expect that the logic you use will be interpreted in the same way every time given the same inputs. When that isn't the case, it's generally considered a bug.
Law and contracts appear to be deterministic, but are in fact not. Anything that is written into a law or contract is subject to interpretation later. There's no attempt at making it exhaustive because it's not possible, nor is it necessarily desirable. Sometimes contracts contain language that becomes invalid later on, and you don't want to define things too tightly or you'll have to modify the contract non-stop. Sometimes things arise which are not spelled out in the contract and as long as the parties agree, there's no problem. The rules around contracts are a lot more bendable than in code, and "it depends" is quite often the answer to many questions. So is there overlap between code and contracts/law? Certainly. But the deeper you go, the more exceptions that arise.