My girlfriend was a lawyer for a few years. Shortly after we met she went to a bootcamp for coding, immediately got a new job, and now (a couple years later) makes something like 4x what she did as a lawyer. Of course she was doing contract work for a small local firm, but that was the best job she could find in the job market as it was.
I always wondered if studying law, also prepares your mind for coding.
Lots of complex preconditions, trying to find clauses that catch all side effects - sounds familiar to me.
So transitioning from law to coding is maybe "just" learning some programming language and technical details, but the mind is already somewhat prepared to the thinking?
I was a lawyer for 15 years or so. Before law, I was a PHP programmer and a C/lisp dabbler. After law, I have been a university researcher doing tons of JS and Python for building experiments and running complex computational modeling analyses. However, I was a philosophy major who focused on logic, which is also a precursor to both law and coding, so it's hard to know what influenced what. Anyway, I would say that they can certainly be quite compatible, if ...
If you are a certain type of lawyer, then law and coding are a natural fit. There are several different types of lawyers. Some like the code aspect of law (literally, the legal code), some like the more social aspects of lawyering -- like negotiating deals and trying to bullshit the answer when you are about to lose your case and networking and just all around helping people out.
My wife is a lawyer. My brother was a lawyer. My wife's brother is a lawyer. Of those three, my brother would not have been a very good programmer, and my wife's brother would rather launch himself into the sun. My wife would be good at it (and she is; I have taught her a little to work on our own family web project), but she is also a good mathematician and good scientist, so it's hard to say how much of it might be from legal training.
The impression I've gotten from talking with her is that law is like the worst codebase you could possibly imagine, running on a machine that doesn't even execute it consistently, where every ambiguity (which abound) is resolved via interpersonal conflict. It sounds like my worst nightmare, personally. She didn't like it either which is part of why she got out.
It's also a ton of rote memorization, which luckily isn't very important for programming because I'm terrible at it.
Somewhere around 2004-2006 I read a blog post / article that I have been unable to find since that was supposed to be from a CS professor at a relatively prestigious university where they had done a study on entering classes for a number of years, at the beginning of the class they gave some very rudimentary problems focused on if you could handle arbitrary rules - those that could ended up passing at a significant rate those who couldn't ended up failing at a significant rate.
The theory was that programming has many arbitrary rules that you need to be aware of work your way around to make things work, why is the language construct like this instead of this other way etc.
The law in many ways is logical but it is an arbitrary logic.
>Lots of complex preconditions, trying to find clauses that catch all side effects - sounds familiar to me.
I think there is another benefit - in that if you have some legal background (not much needed, some business law courses and basic familiarity) then when you are looking at code that you can't figure out why did they do this and think I will improve it! Sometimes the reason they did things in a weird way is because of regulatory requirements and you might be better able to notice those situations.
Also when you are planning features you might be able to determine this needs to be ran past legal more than other developers (at least I've had this experience a few times)
>I always wondered if studying law, also prepares your mind for coding
Could work in reverse too. I met the author Ken Liu at a convention, and he mentioned he started out as a software engineer, and then went to law school. And then began writing on the side as well.
Being mathematically inclined and having worked in software for a decade+ I'm also very good at understanding the complex laws and nuances for international travel in the age of COVID. I'm about to visit 3 countries and from my own research I feel like I'm the world's expert on the congressional bills and executive orders of these countries now (I'm only somewhat kidding)
By the way, I'm a liberal arts graduate (but majoring in math, comp sci and minoring in music)
Modern software stacks are tall enough that the ability to find answers is a key skill.
My favorite interview question is to take something the interviewee doesn't know, toss a laptop in front of them, and ask them to see if they can find an answer. You learn a lot about a person from the way they search.
"I'm a liberal arts graduate (but majoring in math and comp sci and minoring in music)" ... if you're majoring in math... you're not a liberal arts grad.
I personally minored in music composition (with a masters in CS) but I wouldn't describe myself as a liberal arts grad.
I went to a liberal arts college - I don't think most people on HN are familiar with US liberal arts colleges. I have a B.A. degree because no B.Sc. was offered. Lots of requirements for courses outside one discipline or major field of studies - much more so than at non-liberal arts college. Generally liberal arts colleges only offer undergraduate degrees. They also generally do not have research faculty - teaching is the core emphasis.
And the entire ethos of my school was about internationalism and utopian thinking, certainly not about doing real world practical things or even making money.
So liberal arts graduate is still accurate for me.
Knowing how to code prepares you to deal with lawyers that say something is complex but then you verbally break it down into an if-elseif-else in 5m and they get flummoxed. And when you find a possible bug / loop-hole / fuzziness, they tell you they will need weeks to research it on your dime when it has all the complexity of a stack overflow post.
It's not always (or even usually) cluelessness or malice. Law is somewhat like code, except it's like the worst Aspect-Oriented Programming codebase you can imagine - the source in front of you is never the full story. They may need the extra time just to go through possible interactions with codes, precedents, official interpretations, etc.
I once had the lovely task of turning law into code. 3 lawyers, 4 different judges, 3 officers/officials, and dozens of people the code applied to. The amount of 'law' was maybe 10 sentences. But there were books written on how to apply that small bit of law. That set was pretty solid and had 40 years of 'know how that works case law'. Then it got thrown out in court. Total rewrite. Same set of people again. But many had no idea how to even begin to apply that new law. It took nearly 2 years of wrangling with different law organizations to find out how is this going to be applied. It got so bad I was finding bugs in the law and loopholes just because I threw my hands up and exhaustively searched the whole space of actions. Even the guy who had the fun task of writing the law had reservations. I think they fixed the 'bugs' in a new rewrite a few years ago after it got thrown out again in court. Luckily I was out by that point.
Hm, maybe in some instances. But since laws involve humans and the laws are intentionally not always mathematically clear and depend on the current interpretations of the various courts, I would be careful to generalize here.
> and depend on the current interpretations of the various courts
it's run time interpretation vs compiled, and the interpreters vary wildly with respect to speed and how they were built. running a scenario through one court may not give you the same output as another, and may not even give you the same output 6 months later as it did previously.