if you're struggling to stay afloat and have no credit/assets, a short time in jail is way worse than bankruptcy. on the other hand, if you've worked as a SWE for a few years, loosing all your money and having terrible credit for years is pretty awful. you're broke, so you can't buy anything outright, and your losses are compounded by the fact that you pay much more interest on things you buy on credit (if you can even get financing at all). it's not hard to see that this could be worse than a short time in jail. it all depends on the length of the sentence and your total losses from bankruptcy.