I used to work as an attorney, quit to join a coding boot camp, transitioned to web development, and now I'm employed as a software engineer.
When I was a lawyer, I bounced around a few different jobs--mostly in litigation. I started off as a public defender before moving on to private criminal defense, then doing some work as a legislative researcher, and finally ending my career in plaintiffs' civil rights litigation. That might all sound fun and exciting, but, frankly, the work is just plain boring. You interview your client, listen to their story, read some reports, filter out relevant evidence, do some legal research to support your arguments, read and write some briefs, cut a deal with opposing counsel, sit around waiting in court, suck up to some power-tripping judge, get a thankless goodbye from your client, rinse, wipe, repeat. Throw in a jury trial here and there and now you're having some fun, but get ready to basically be a used car salesman, because you've got to sell your client's story whether you believe it or not. Depending on the facts of your case (as known to you) and the strength of your conscience, that can be a tough and soul-sucking task. And if you stick with government work, you probably won't be making six figures until you're very high up the totem pole (10+ years into your career).
After about 6-7 years of it, I realized that I could separate most of the older lawyers into two groups: true believers and functional burnouts. The true believers are really gung-ho about what they do because they really do think their job is the most important job in the world, and they really shine. Those are the lawyers you want to hire. But the majority of them are just going through the motions and are too afraid to try something else because they've invested so much time and effort into their careers, they've got kids and a mortgage, they've got golden handcuffs, and "being a lawyer" is simply what defines their identity. I might have started off as a true believer, but over time, I started seeing a lot more gray in the work I did--to the point where it was a daily struggle to deal with the cognitive dissonance. You're on the fast-track to burnout at that point, so I figured it was a good time to bounce. I had always been a lot more technically adept than most lawyers (some can be borderline luddites, probably because technology represents a threat to their billable hours), so the transition to tech was a smooth and enjoyable one. I don't regret the decision.
Could I get burned out in tech, too? Sure, but it suits my overall disposition better, so I think there's a little more room to push myself before that happens. I'd rather fight with computers than people, so I feel pretty safe (until I wind up in management). Really just depends on what your personal values are. I wouldn't necessarily discourage someone from becoming a lawyer, but you might want to make sure you have a damn good reason for wanting it. If you're a committed ideologue, there's opportunity there in litigation. If you just want to be a glorified service industry professional having people fill out the right forms, there's opportunity in transactional work. But... eh, you're going to be doing a lot of babysitting either way, and it's not a particularly "creative" line of work. Whatever you do, don't take on an insane amount of debt. I went to a state school and got a lot of grant money, so I basically went to law school for the same cost as a brand new Camaro. If I took on a 6-figure debt load, I'd be up shit creek today.