{"id":2800,"date":"2009-09-08T14:21:42","date_gmt":"2009-09-08T18:21:42","guid":{"rendered":"http:\/\/www.starkeith.net\/coredump\/?p=2800"},"modified":"2009-09-08T17:22:28","modified_gmt":"2009-09-08T21:22:28","slug":"treating-our-legal-code-like-computer-code","status":"publish","type":"post","link":"https:\/\/www.starkeith.net\/coredump\/2009\/09\/08\/treating-our-legal-code-like-computer-code\/","title":{"rendered":"Treating our Legal Code like Computer Code"},"content":{"rendered":"<p>I\u2019ve <a href=\"http:\/\/www.starkeith.net\/coredump\/2008\/02\/19\/legal-system-as-a-perl-os\/\">posted before about the idea of treating our legal system (legal code) like a computer system (computer code)<\/a>:<\/p>\n<blockquote><p>Our legal code is almost entirely like an entire operating system written in undocumented Perl.<\/p>\n<ol>\n<li>There are no hints as to what any part of it is supposed to do and it is written in a language that to most people looks like line noise.<\/li>\n<li>Every significant patch is applied by adding an additional Perl module that overrides an existing method in an existing module, replacing all of the code in that method with a complete new copy of the method that is almost identical to the old one but adds or removes a backslash in a single regular expression.<\/li>\n<li>The entire core logic was written in a crunch session by a bunch of geeks locked in a room together and forced to design it by committee.<\/li>\n<li>The application was a rewrite of another application that never really worked well in the first place.<\/li>\n<li>Every function name is chosen explicitly to provoke an emotional response in the developer, e.g. thisFunctionSucks() or callMeNow().<\/li>\n<\/ol>\n<\/blockquote>\n<p>Although that was somewhat tongue-in-cheek, there was a certain grain of truth to it.<\/p>\n<p>It seems that I\u2019m not the only one to think this \u2013 and indeed, <a href=\"http:\/\/brucefwebster.com\/2009\/09\/07\/hr-3200-from-a-systems-design-perspective-part-i\/\">someone has taken the idea even further by applying systems design principles to the new health care reform legislation that the US Congress is working on at the moment<\/a>.<\/p>\n<p><a href=\"http:\/\/brucefwebster.com\/\">Bruce F. Webster<\/a> writes:<\/p>\n<blockquote><p>On the occasions where I have reviewed the actual text of major legislation, I have been struck by the parallels between legislation and software, particularly in terms of the pitfalls and issues with architecture, design, implementation, testing, and deployment. Some of the tradeoffs are even the same, such as trading off the risk of \u201canalysis paralysis\u201d (never moving beyond the research and analysis phase) and the risks of unintended consequences from rushing ill-formed software into production. Yet another similarity is that both software and legislation tend to leverage off of, interact with, call upon, extend, and\/or replace existing software and legislation.\u00a0 Finally, the more complex a given system or piece of legislation is, the less likely that it will achieve the original intent.<\/p><\/blockquote>\n<p>He then goes on to talk about some \u201cdesign flaws\u201d in <a href=\"http:\/\/www.opencongress.org\/bill\/111-h3200\/text\">HR 3200<\/a> \u2013 otherwise known as the \u201cAmerica\u2019s Affordable Health Choices Act of 2009.\u201d (Brings to mind point #5 from the \u201cLegal System as a Perl OS\u201d quote from above, doesn\u2019t it?)<\/p>\n<p>Bruce then goes on make a point which is basically the same as point #2 in the \u201cLegal System as a Perl OS\u201d quote above:<\/p>\n<blockquote><p>Much of HR 3200 makes piecemeal modifications to existing legislation, often with little explanation as to intent and consequences.<\/p><\/blockquote>\n<p>Or to put it another way, entire sections of HR 3200 do nothing other than override some existing legislation in some incredibly small way, which will (presumably?) have huge (and in all likelihood, unintended and unforeseen) effects \u2013 much like how adding or removing a single backslash from a regular expression can have huge (and often unintended and unforeseen) effects on its pattern-matching behavior.<\/p>\n<p>Bruce\u2019s entire article (it\u2019s the first of a 3-part series \u2013 as I write this, only parts 1 and 2 are done) is well worth reading \u2013 and in fact I highly recommend it, even for non-programmers.<\/p>\n<p>Of course, if you ask me, I really think all legislators should be required to take a programming course or two \u2013 because, as I\u2019ve said before (in my \u201c<a href=\"http:\/\/www.starkeith.net\/coredump\/2008\/11\/03\/a-programmers-perspective-on-politics\/\">A Programmer\u2019s Perspective on Politics<\/a>\u201d article), laws are effectively the \u201coperating system\u201d of our society\u2026 and right now, the people writing our society\u2019s \u201coperating system\u201d don\u2019t seem to be particularly good programmers!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Looking at some pending legislation through the eyes of a computer programmer&#8230; and finding it&#8230; wanting.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"webmentions_disabled_pings":false,"webmentions_disabled":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_post_was_ever_published":false},"categories":[199,2],"tags":[230,229,226,113,100,385,107],"class_list":["post-2800","post","type-post","status-publish","format-standard","hentry","category-my-opinion","category-politics","tag-health-care","tag-hr3200","tag-laws","tag-legal","tag-opinion","tag-politics","tag-programming","entry"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pimUj-Ja","jetpack-related-posts":[{"id":1053,"url":"https:\/\/www.starkeith.net\/coredump\/2008\/02\/19\/legal-system-as-a-perl-os\/","url_meta":{"origin":2800,"position":0},"title":"Legal System as a Perl OS?","author":"Keith Survell","date":"February 19, 2008","format":false,"excerpt":"OK, you really do have to be a geek to understand this, but that doesn't make it any less funny: Our legal code is almost entirely like an entire operating system written in undocumented Perl. There are no hints as to what any part of it is supposed to do\u2026","rel":"","context":"In &quot;fun stuff&quot;","block_context":{"text":"fun stuff","link":"https:\/\/www.starkeith.net\/coredump\/category\/fun-stuff\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1462,"url":"https:\/\/www.starkeith.net\/coredump\/2008\/11\/03\/a-programmers-perspective-on-politics\/","url_meta":{"origin":2800,"position":1},"title":"A Programmer&#8217;s Perspective on Politics","author":"Keith Survell","date":"November 3, 2008","format":false,"excerpt":"Election time always finds me musing on the nature of politics. Of course I must admit that being a computer programmer colors my view of the whole process more than just a little bit. I mean, I know that the political process in this country is one that has evolved\u2026","rel":"","context":"In &quot;politics&quot;","block_context":{"text":"politics","link":"https:\/\/www.starkeith.net\/coredump\/category\/politics\/"},"img":{"alt_text":"Image courtesty Flikr user umjanedoan","src":"https:\/\/i0.wp.com\/www.starkeith.net\/coredump\/wp-content\/uploads\/\/2008\/11\/really-old-law-books.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1201,"url":"https:\/\/www.starkeith.net\/coredump\/2008\/07\/10\/some-of-my-programming-book-recommendations\/","url_meta":{"origin":2800,"position":2},"title":"Some of MY Programming Book Recommendations","author":"Keith Survell","date":"July 10, 2008","format":false,"excerpt":"Well, I shouldn't say \"recommendations,\" since I'm just recommending one book: Testing Computer Software (Second Edition) by Cem Kaner, Jack Falk, and Hung Quoc Nguyen. This is an utterly invaluable book for anyone who ever aspires to be more than just a code monkey. Technically speaking, this book was written\u2026","rel":"","context":"In &quot;My Opinion&quot;","block_context":{"text":"My Opinion","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/my-opinion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1281,"url":"https:\/\/www.starkeith.net\/coredump\/2008\/08\/13\/10-tips-for-new-programmers\/","url_meta":{"origin":2800,"position":3},"title":"10 Tips for New Programmers","author":"Keith Survell","date":"August 13, 2008","format":false,"excerpt":"It occurred to me the other day that I've been doing this stuff (programming) for more than a few years now - most of them in a very much \"professional\" manner. So I guess that makes me qualified to come up with lists like this! Learn the machine. Build yourself\u2026","rel":"","context":"In &quot;My Opinion&quot;","block_context":{"text":"My Opinion","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/my-opinion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":177,"url":"https:\/\/www.starkeith.net\/coredump\/2004\/07\/27\/how-to-hack\/","url_meta":{"origin":2800,"position":4},"title":"&#8220;How To Hack&#8221;","author":"Keith Survell","date":"July 27, 2004","format":false,"excerpt":"\"How To Hack,\" a brief guide to hacking (the way of thinking more than anything else) by: Keith M. Survell.","rel":"","context":"In &quot;personal&quot;","block_context":{"text":"personal","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1882,"url":"https:\/\/www.starkeith.net\/coredump\/2009\/04\/09\/communication-and-programming\/","url_meta":{"origin":2800,"position":5},"title":"Communication and Programming","author":"Keith Survell","date":"April 9, 2009","format":false,"excerpt":"Programming is all about communicating - communicating with the computer, and with other people. So it follows that to be a good programmer, you need to be a good communicator, too.","rel":"","context":"In &quot;My Opinion&quot;","block_context":{"text":"My Opinion","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/my-opinion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/posts\/2800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/comments?post=2800"}],"version-history":[{"count":0,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/posts\/2800\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/media?parent=2800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/categories?post=2800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/tags?post=2800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}