

Coding for Lawyers - jbarrow
http://codingforlawyers.com

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

~~~
igurari
Most lawyers understand the concept of a regex, so I'd agree that its a good
place to start. Law students are taught how to search for caselaw using Terms
and Connectors, which is a simplified form of regex:
[http://lscontent.westlaw.com/images/content/WLNT&CSearching....](http://lscontent.westlaw.com/images/content/WLNT&CSearching.pdf)

So they already have a lot of familiarity with the topic, and this just makes
it easy for them to understand that coding is not so foreign as they might
otherwise believe.

~~~
the_watcher
Having been to law school in the last 3 years (would have taken the bar 2
months ago had I finished), you are overestimating how many law students
actually learn how to perform Westlaw/Lexis searches like that. You only
really need to use them in a few select classes, and no one really attends
anything more than the mandatory trainings (which cover things like how to log
in).

~~~
MWil
our mandatory legal research class covered wildcard searches and "w/" x number
of words/characters

~~~
the_watcher
I guess mine covered wildcards and some search operators, now that I look
back. Nothing that remotely prepared me for learning regex though.

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

------
afarrell
If you wish lawforcoders.com existed, you should read
[http://lawcomic.net/](http://lawcomic.net/)

~~~
igurari
A different style, but wonderful to read and illustrative of the often
craziness of law, is Margaret Hagen's work:

Law Flow Charts: [http://www.margarethagan.com/drawings/illustrated-law-
flow-c...](http://www.margarethagan.com/drawings/illustrated-law-flow-charts/)

Law Cases: [http://www.margarethagan.com/drawings/drawn-law-
cases/](http://www.margarethagan.com/drawings/drawn-law-cases/)

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

~~~
squar1sm
Nice insight. I liked that.

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

~~~
ap22213
That's an interesting story. I know a guy who's a senior developer - probably
makes $190k a year. He just codes copy-paste. I think he makes a lot because
he puts out products really fast, and clients are really impressed. But, he
completely ignores any maintenance. He just hands off the code to some other
poor souls who have to maintain it. And, then they look bad, because what used
to take hours now takes weeks.

DRY is good when you care about maintenance or design, but to those who don't
understand or care about maintenance, it just looks like added complexity.

Or, in other words, a lot more people would rather buy a junky watch with a
fashionable aesthetics than a simple-looking watch with impeccable internals.

------
mooreds
Since law is "code for society", I am all on favor of equipping its
practitioners with more insight into software.

~~~
adamc
That's a pretty loose analogy. Law doesn't execute. I guess you could think of
it as source, but the execution engine is a lot more, um, variable.

~~~
jackweirdy
Not to mention society changes law, and when society doesn't like law, they
can ditch it and make a new one

~~~
the_watcher
That's an extremely optimistic view of how easy it is to ditch laws.

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

------
pinkyand
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/](http://www.regexbuddy.com/)

~~~
the_watcher
I don't think the point is to offer them a tool, the point is to offer them
the option of some coding education designed specifically for their
background. Agreed that the tool you mentioned is probably more useful to more
lawyers, I just think this is targeting a segment looking to go beyond a tool
that does the work for them

------
Total_Meltdown
Do you accept pull requests?

From Chapter 3, Exhibit 6:

    
    
        {
            "title": "Hey Jude" // <-- Missing comma
            "group": "Beatles",
            ...
        }

~~~
adelevie
I'm not the author (but I know him and he doesn't have an HN account--I've
also contributed a chapter currently awaiting as a PR). PRs are certainly
welcome.

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

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

~~~
mountainair
Lawyers don't necessarily need to code to improve their own lives - but they
MUST learn to code to improve their relationships with their clients.

If there is any aspect of programming involved in any contract or lawsuit
(which is becoming the norm), the lawyer absolutely must have at least a vague
grasp of the tech to be effective. Too many lawyers and judges are just
utterly perplexed, and it leads to bad law that makes things more difficult
for everyone down the road.

Even the most basic understanding of programming would be so so helpful, if
only because it makes the world of computers slightly less alien to your
average legal practitioner.

~~~
HeyLaughingBoy
I doubt that.

I'm negotiating a contract with a software subcontractor and I had to involve
our legal department. The lawyer I'm dealing with quite clearly understands
software (speaks knowledgeably about OSS, although I don't remember if he's
actually a programmer), but I can't think of a single case where programming
knowledge would have been useful. Instead, _I 'm_ the outsider, because
everything that comes up for discussion is an issue of Contract Law and
nothing specific to Software.

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

------
nibjib
What about the converse - lawforcoders.com ... or is that essentially what
groklaw was?

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

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

If the author is reading this:

WHY? out of all the horrors, why?

~~~
Mithaldu
That question is answered in foot note one of chapter 1:
[http://codingforlawyers.com/chapters/ch1/](http://codingforlawyers.com/chapters/ch1/)

Maybe try reading a thing before breaking out the multi-punctuation and caps?
;)

~~~
barkingcat
I would actually vote version control as chapter 1 of Coding for Lawyers. Also
not "coding" per se, but immensely important - anything to get past
"importantdocument.version.13.3.barkingcat.doc" hell.

~~~
adelevie
I sent a pull request with a chapter on diffs[1]. They're important in their
own right, but also as a good precursor to the inevitable git/github/version
control chapter[2].

[1]
([https://github.com/vzvenyach/codingforlawyers/pull/10](https://github.com/vzvenyach/codingforlawyers/pull/10))
[2]
[https://github.com/vzvenyach/codingforlawyers/issues/5](https://github.com/vzvenyach/codingforlawyers/issues/5)

