6 ms·
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 s
by eranation 10y ago
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])
- Karunamon 10y agoThere'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.
- charliedevolve 10y agoThat'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.
- JoshTriplett 10y ago> 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...
- jacques_chester 10y agoJurors 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.
- JoshTriplett 10y ago> 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.
- jacques_chester 10y ago> 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/law_related_education_network/how_courts_work/juryinstruct.html http://www.americanbar.org/groups/public_education/resources...
- jpalomaki 10y agoInteresting 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 https://en.wikipedia.org/wiki/Computational_law
- andrewfong 10y agoCode 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.
- Rumudiez 10y agoIf 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.
- M_Grey 10y agoI 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.
- harryh 10y agoBecause law is written to allow for interpretation when unforeseen circumstances are encountered.
- Retr0spectrum 10y agoUsually 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 https://en.wikipedia.org/wiki/Controlled_natural_language
- walshemj 10y agoI think you meant to allow for big payday for lawyers to argue about for a decade or so
- nv-vn 10y agoOr 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.
- m3ta 10y agoEthereum 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.
- johnlbevan2 10y agoOn 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.
- mannykannot 10y agoTesting? With respect to what requirements?
- deckar01 10y agoInstead 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.
- sillysaurus3 10y agoInstead 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?
- berberous 10y agoThis 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: .....
- rayiner 10y agoUsing 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-insertion 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?
- tropo 10y agofish 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)
- hawkice 10y agoOr 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.
- microcolonel 10y agoLojban-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.
- InclinedPlane 10y agoAh 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?
- hinkley 10y agoOnce 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.
- jeremy_wiebe 10y agoCoworkers...right.
- TheSpiceIsLife 10y agoIf all you have is a compiler, everything looks like a line of code.
- EpicEng 10y agoAnd we never ever write bugs, right?
- inopinatus 10y agoThe 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.