from Hacker News

Coding for Lawyers

by jbarrow on 9/15/14, 2:02 PM with 43 comments

  • by hobs on 9/15/14, 3:18 PM

    This guys is a laywer, with a mechanical engineering degree, and does coding on the side.

    He was also the guy who wrote the SCOTUS opinion tracking software that was all over HN a few months ago.

    Seems like a cool guy, and unlike some posters I think regex are definitely something to start people off on.

    Many people who are non-technical but have used a computer understand the concept of a wildcard operator, you just expand that knowledge a bit and they can do very powerful things if their jobs involves a large amount of text.

    I had some realtors that I worked with, and after seeing me fly through some of the things they did, they were eager for me to teach a bit about regex (and gave them a simple simulator to give them instant matches, I think it was rubular at the time) and they wrote some simple rules to take like 10 hours of drudgery out of their jobs per week.

  • by danso on 9/15/14, 3:05 PM

    This project immediately won my heart by starting off with regular expressions. It amazes me how many coders flip out at the suggestion of teaching/advocating regexes to novices, as if the first thing a novice will attempt to do is parse HTML with regex or build a credit card validation application.

    I've spent most of my life in the journalism world, and I imagine parts of it, especially the investigative projects time, share some characteristics with the law world...in that you're dealing with messy documents and data. You would not f--king believe how much time is wasted on manually reading lists of names/addresses, because the person has no idea how to split "Smith, Bob -- 1020 Broadway, NY" into a spreadsheet. Nevermind the countless hours spent hand fixing whitespace or other formatting errors, things that could take seconds with even just Sublime Text.

    Regexes are amazing because they teach people how to think in patterns, and that manually defining the pattern for your specific domain can be a very powerful thing. I've greatly increased the speed that I can research things across large document sets...simply by grepping documents for patterns that fit proper nouns, or even large money values (for example, /(?:\d{3},){2,}/)...when dealing with messily OCR'ed documents, in which phrases/words will have common mistranslations, being able to grep in order to find a key name/number/noun is incredibly powerful.

    IMO, regex is exactly the first thing you should be teaching people like lawyers and researchers. It's a very powerful programming concept, but besides that, it is immediately useful to anyone who can use a text editor. And it opens the door to programming in general (because find-and-replace with a text editor gets old, you'll soon find the need to run grep from the CLI)

  • by afarrell on 9/15/14, 2:52 PM

    If you wish lawforcoders.com existed, you should read http://lawcomic.net/
  • by tkiley on 9/15/14, 5:49 PM

    I'm intrigued by the parallels between software engineering (scripting, really) and legal work.

    In a sense, a legal agreement seems like a cross-platform piece of software that is "executed" in the minds of the signing parties, their business associates, and occasionally the court system. Given that context, I'm a little surprised that lawyers and engineers tend to communicate and think so differently.

  • by themodelplumber on 9/15/14, 2:36 PM

    Seeing DRY at the end there was amusing. I recently worked with a client who convinced me he was really interested in our web project's back-end. Normally I keep things really light, but this guy had a convincing air of tech-savvy about him.

    Toward the end of the project, he wanted to do a lot of copy/paste-style "reuse" within the content management portion of the project, so I showed him how he could take advantage of the de-duplication features, and explained what DRY meant--just in terms of content management.

    The next day I got an email about a bug he found, where a sidebar wasn't showing up properly or something like that.

    His conclusion at the end of the email read:

    "So this DRY thing doesn't seem to be working, can we please remove DRY?"

    (I know, it's my fault for exposing the innocent client to such heavy terminology, blah blah blah...but I had a very pleasurable laugh about the whole thing)

  • by mooreds on 9/15/14, 2:24 PM

    Since law is "code for society", I am all on favor of equipping its practitioners with more insight into software.
  • by the_watcher on 9/15/14, 8:05 PM

    I haven't gone through this yet, but I have a liberal arts degree and did a year of law school before dropping out to work on the internet. I'm competent in HTML/CSS, basically competent with Rails (have built very rudimentary web apps), but working full time in online marketing.

    If this is actually an intro to coding for lawyers, it's an intro to programming for those with no technical background whatsoever. Which is really cool (not that those don't exist, but specifically designing this for a career path full of liberal arts types, not just for those with no experience, is interesting). I like that they start with regex and HTML/markdown, since, while they are not what anyone would call software development, they are a simple, quickly useful example of the basic concept of coding - expressing human instructions in a language designed to be understood by a machine. They also are some of the more quickly usable "coding" concepts, HTML & Markdown in the obvious cases, but regex familiarity makes Google Analytics much more powerful.

    Looking forward to working through it and seeing what it's like. I sent it on to a few law school friends who had been somewhat interested in tech skills too.

  • by pinkyand on 9/15/14, 5:19 PM

    That's a good idea , but it could be greatly improved by offering lawyers(which are surely time strapped) , a tool like RegexMagic[1] , which really simplifies the learning needed and lets one easily understand complex regex's.

    [1]http://www.regexbuddy.com/

  • by Total_Meltdown on 9/15/14, 2:52 PM

    Do you accept pull requests?

    From Chapter 3, Exhibit 6:

        {
            "title": "Hey Jude" // <-- Missing comma
            "group": "Beatles",
            ...
        }
  • by stevekl on 9/15/14, 3:24 PM

    I am so glad that this started off with REGEX.

    So many coding lessons are so irrelevant to business / law people. No, business people don't need to really learn how to code. They want to learn how to parse / clean messy spreadsheet data.

    REGEX + basic loops and conditional in VBA will do wonders to the productivity of business people.

    On a separate note, I am surprized that there is still no good graphical way to build regexes

  • by jroes on 9/15/14, 4:08 PM

    I like the idea of niching down for a use case, but I've never met a lawyer I thought had the time or energy to devote to learning programming. I'm also having trouble understanding how a lawyer might use their programming skill to improve their daily lives. It seems to me that other folks on a lawyer's staff would be more likely to be interested in this subject and use it to the firm's benefit.
  • by adultSwim on 9/15/14, 6:42 PM

    Typo:

    [0-9]{1,2} U\.S\.\C. § \d+(\w+)?( \([0-9]{4}\))? Should probably be:

    [0-9]{1,2} U\.S\.C\. § \d+(\w+)?( \([0-9]{4}\))?

    \C. -> C\.

    Great work! The line between computer user and computer programmer needs to be blurred. Many people who use computers would benefit from knowing a little programming. Just look at how useful Excel is.

  • by nibjib on 9/15/14, 2:50 PM

    What about the converse - lawforcoders.com ... or is that essentially what groklaw was?
  • by xyclos on 9/15/14, 7:02 PM

    one of my cs profs was also a lawyer who does consulting for startups in addition to teaching coding. he used the same example to teach us regex.
  • by jorgeleo on 9/15/14, 2:29 PM

    Lets start teaching what code is by ... chapter 1 Regex????

    If the author is reading this:

    WHY? out of all the horrors, why?