Do you always code alone?
That aside, a computer as an audience is deterministic, discrete and fully knowable in operation. Can that be said for the entity that is a body of people?
Yet, in fact, laws are often written a lot like code; formally and in great detail. There is scope for them to be much more complicated because they (only partially) govern a far more complex system.