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