Eventually you'll have millions of lines of code, and within those millions of lines of code there will be a bug. It's no different than writing a legal contract in English. In both cases you can only do your best to make sure there is no misunderstanding or undefined behavior, but there is always a possibility that at some point someone will find a flaw and exploit it.
Isn't that how common law already works?
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.
The nice thing about code is that we can reveal bugs by executing the code and comparing the results with our expectations. Ideally, we do this with lots of testing. But even then, there's a hole in coverage and bugs make it into prod and cost someone lots of money. Which is basically what happened here.
the (i) canning, (ii) processing, (iii) preserving, (iv) freezing, (v) drying, (vi) marketing, (vii) storing, (viii) packing for shipment or (ix) distribution of: .....
As a former freelancer, being able to write a simple business agreement and explain good faith to clients was empowering. None of my clients could have afforded to compensate me for hiring a lawyer to write in legalese, and would have been put off at such lengthy contracts despite the relatively straightforward projects.
What happened here is what happens when someone with insufficient skill tries to write an L program. The language has no such thing as linting or syntax checking, so while a faulty program will always run, it will return with unexpected or absurd results. L failures tend to make C's nasal demons look positively friendly by comparison.
There's no formal spec, it's literally centuries of ad-hoc patches and fixes and revisions piled onto one another.
Worse than that, legal "code" has thousands of frequently used implementations (judges) and millions of one-time-use implementations (jurors), all of which may interpret it differently, both from each other and even from their own past versions. So if you thought writing JavaScript was bad because you have to deal with a half-dozen browser implementations and quirks...
The legal system is massively reliable. By the time something reaches an appeal court, you're already into 5th 9 territory. You can live an entire life under it, moving through it, completely surrounded by it, and never have to see it or think about it.
They can and do. Quoting the Oregon constitution:
"In all criminal cases whatever, the jury shall have the right to determine the law, and the facts under the direction of the Court as to the law, and the right of new trial, as in civil cases."
Similar measures exist in other legal jurisdictions, though it isn't universal.
> judges have a well-organised system for exception handling
I didn't suggest they don't; I suggested that two different judges can interpret the law differently.
The point here is that jurors decide on facts according to law, as instructed by a judge[0]. The judge is also asked during trial to consider legal questions -- not the jurors.
> I suggested that two different judges can interpret the law differently.
I suggested that is why there is a hierarchy of courts, with the hardest and most important ones being delegated upwards via the process of appeal.
I am, of course, not a lawyer and this isn't legal advice. I did enjoy my time in law school though. The main thing I learned is that the law is a language that resembles but is not common English. Phrases like the one you quoted have to be read in the larger context of case law and statute law.
[0] http://www.americanbar.org/groups/public_education/resources...
1. the result of multiplying fishes, as done by Jesus
2. a type of multiplication indicated by the fish symbol (see also: dot product, cross product)
3. a product intended for use by fish
4. the yearly economic value produced by fish (see also: gross national product)
[0] https://en.wikipedia.org/wiki/Controlled_natural_language
How much perfect code have you come across in your life?
No compiler or anyone who can read code ever had any ambiguity reading simple code.
let overtime_allowed = true unless (action in [canning, processing, preserving, freezing, drying, marketing, storing, packing_for (shipment or distribution)] of [Agricultural produce, Meat and fish products, Perishable foods])