Hacker News new | ask | show | jobs
by johnlbevan2 3378 days ago
On the other hand, you could add tests; i.e. list case examples of outcomes and ensure that the laws meet those tests. That would be particularly helpful in capturing where new laws or changes to laws may create loopholes in other laws. As you say, code can have bugs; test code too; but at least this enforces a more rigorous syntax and saves a fortune in having lawyers debate the meaning of the language used.
2 comments

Instead of encoding laws in a programming language, they could encode the test cases in a natural language. List a bunch of specific scenarios and be explicit about how the law should be interpreted for them. Every time a judge makes a ruling on an uncovered scenario it gets added to the list. This would take about 90% of the work out of being a lawyer and would make the legal system much more accessible.
Instead of encoding laws in a programming language, they could encode the test cases in a natural language. List a bunch of specific scenarios and be explicit about how the law should be interpreted for them. Every time a judge makes a ruling on an uncovered scenario it gets added to the list.

Isn't that how common law already works?

I think that was the joke, but I'm not 100% sure....
The tests are the lawsuits.
This is how some uniform laws are written. For example, each section of the Uniform Commercial Code (UCC) is followed by commentary, often including example situations. States are encouraged by the UCC committee to incorporate the commentary as part of the official statutes. That makes them binding. Where states choose not to incorporate the commentary, judges usually treat them as strongly persuasive (if non-binding) authority.

The nice thing about the code commentary is that it's easier to append or modify the commentary than a code provision itself. When a provision is changed all the case law is effectively discarded, creating tremendous uncertainty. But changing the commentary is much less likely to break backward compatibility, so to speak.

Of course, the UCC is much more carefully written and reviewed than ad hoc state legislation. The commentary is a little like gilding the lily, relatively speaking.

Testing? With respect to what requirements?