If you're capable of becoming a lawyer you're capable of becoming a programmer. 38 ain't that old.
But why drop being attorney?
In-house counsel jobs can be a bit more relaxing, as you might be working on longer term projects rather than the latest disaster that fell into your lap.
It is, but you have to be quite the expert. It's not like app development where even limited experience can be enough to get by. However if you like that sort of stuff you can try to become a web develoepr (pick say Python or Ruby) and then become an expert in backendy / performence issues.
<filterbubble> one source which supports my worldview: https://www.thecareercookbook.com/hello-world-6/ </filterbubble>