News for hackers. Stuff that matters.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by eranation on Friday March 17, 2017 @01:12PM (#13895783)
Why on earth not to use programming language like constructs to write legal documents.

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])

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by m3ta on Friday March 17, 2017 @02:54PM (#13896843)
Ethereum tried this, and a bug in the code lead to millions of dollars of value lost. They ended up hard-forking the code by changing it to match the intended outcome of the code, thus reversing the actual outcome of the execution of that code.

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.

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by johnlbevan2 on Friday March 17, 2017 @05:54PM (#13898314)
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.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by deckar01 on Friday March 17, 2017 @07:47PM (#13898974)
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.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by sillysaurus3 on Friday March 17, 2017 @07:54PM (#13899009)
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?

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by AdamJacobMuller on Friday March 17, 2017 @11:02PM (#13899666)
I think that was the joke, but I'm not 100% sure....
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by sillysaurus3 on Friday March 17, 2017 @11:20PM (#13899707)
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by e40 on Saturday March 18, 2017 @04:52AM (#13900499)
The tests are the lawsuits.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by wahern on Monday March 20, 2017 @01:34PM (#13916033)
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.

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by mannykannot on Friday March 17, 2017 @07:00PM (#13898714)
Testing? With respect to what requirements?
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by andrewfong on Friday March 17, 2017 @01:35PM (#13896023)
Code is very often ambiguous with respect to the coder's intent. I've seen plenty of bugs because the coder inadvertently used `=` instead of `==` (or `==` instead of `===`) or left out parentheses in conditionals (`!w || x && y || z`).

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.

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by berberous on Friday March 17, 2017 @03:24PM (#13897142)
This is just as easy to write in English without ambiguity:

the (i) canning, (ii) processing, (iii) preserving, (iv) freezing, (v) drying, (vi) marketing, (vii) storing, (viii) packing for shipment or (ix) distribution of: .....

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by Rumudiez on Friday March 17, 2017 @01:41PM (#13896102)
If that were the case, following the "spirit of the law" would become basically moot and writing legal documents would become significantly more involved.

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.

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by M_Grey on Friday March 17, 2017 @01:50PM (#13896201)
I think people get the wrong impression about things too, because your story is definitely the more common one than the article. Of course, no one goes around writing articles about the peaceful and uneventful transfer of property or rights, so there's a skewed perception of the risks.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by Karunamon on Friday March 17, 2017 @01:27PM (#13895939)
There's an argument to be made that it already is. It's called lawyerese (or just L), its programmers are highly regulated and highly paid.

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.

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by JoshTriplett on Friday March 17, 2017 @01:45PM (#13896145)
> 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.

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...

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by jacques_chester on Saturday March 18, 2017 @12:24AM (#13899880)
Jurors don't interpret law and judges have a well-organised system for exception handling.

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.

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by JoshTriplett on Saturday March 18, 2017 @02:33AM (#13900200)
> Jurors don't interpret law

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.

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by jacques_chester on Saturday March 18, 2017 @02:02PM (#13902598)
> under the direction of the Court as to the law

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...

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by charliedevolve on Friday March 17, 2017 @01:36PM (#13896037)
That's not what happened in this case. The statute was written in accordance with the style guide, which made it ambiguous, which is why it went to court in the first place.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by rayiner on Friday March 17, 2017 @03:30PM (#13897195)
Using a programming language would avoid the scenario where there is more than one valid way to parse the same text. Usually, that's not the problem, though. Often times, the problem is that the correct parse is not the one people intended. Programming languages suffer from that too: http://lucumr.pocoo.org/2011/2/6/automatic-semicolon-inserti.... And even more commonly, the problem is ambiguity in semantics rather than ambiguity in syntax. What is a "fish product," for example?
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by tropo on Friday March 17, 2017 @07:10PM (#13898753)
fish product:

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)

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by hawkice on Saturday March 18, 2017 @02:37AM (#13900209)
Or a product made from fish (you may have a category, sales of fish and fish products). Or a product made by the fishes themselves, like corals are a product of marine life more generally.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by harryh on Friday March 17, 2017 @01:46PM (#13896159)
Because law is written to allow for interpretation when unforeseen circumstances are encountered.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by Retr0spectrum on Friday March 17, 2017 @01:52PM (#13896215)
Usually with the aim to maintain consistency with the intent of the law. If the intent is ambiguous, you can't easily do that (as this case demonstrates). A formally defined Controlled Natural Language[0] would be ideal for situations like this. Arguably "Legalese" already is it's own form of CNL, albeit not very well controlled.

[0] https://en.wikipedia.org/wiki/Controlled_natural_language

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by walshemj on Friday March 17, 2017 @03:01PM (#13896918)
I think you meant to allow for big payday for lawyers to argue about for a decade or so
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by jpalomaki on Friday March 17, 2017 @01:29PM (#13895974)
Interesting idea, short googling lead me here: "Computational Law is a branch of Legal Informatics concerned with the mechanization of legal reasoning (whether done by humans or by computers).[1] It emphasizes explicit behavioral constraints and eschews implicit rules of conduct. Importantly, there is a commitment to a level of rigor in specifying laws that is sufficient to support entirely mechanical processing."

https://en.wikipedia.org/wiki/Computational_law

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by hinkley on Friday March 17, 2017 @05:38PM (#13898206)
Once I figure out how to get my coworkers to stop checking in code with basic logic errors in it, I'll get right on that.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by jeremy_wiebe on Friday March 17, 2017 @07:17PM (#13898789)
Coworkers...right.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by InclinedPlane on Friday March 17, 2017 @05:25PM (#13898126)
Ah yes, a classic. I always love coders who are so naive they think computers are deterministic and code can be perfected.

How much perfect code have you come across in your life?

Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by nv-vn on Friday March 17, 2017 @02:22PM (#13896541)
Or even better, come up with punctuation that supports nesting and makes grouping clear. So you could literally reuse the language, but surround each term in the list in { ... } or something similar.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by inopinatus on Thursday March 23, 2017 @09:26PM (#13945817)
The law is not a programming language. Believing so is a common misconception amongst engineers, but representing it as such is likely (as I have said in this forum before) to lead to disappointment, frustration, anger, needless bickering, extended conflict, and vexatiously long, hard to read, and mostly unenforceable contracts.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by microcolonel on Friday March 17, 2017 @04:46PM (#13897849)
Lojban-style formal legalese could work, but then it would threaten the legitimacy of contracts, since you'd need to understand law-specific distinctions in language to have a meeting of the minds.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by TheSpiceIsLife on Friday March 17, 2017 @07:14PM (#13898773)
If all you have is a compiler, everything looks like a line of code.
Re: Lack of Oxford Comma Could Cost Maine Company Millions i... by EpicEng on Friday March 17, 2017 @11:32PM (#13899741)
And we never ever write bugs, right?