Whilst I agree with Matt's advice, I disagree that the law is not logical. It is fundamentally logical and shares many of the ideas found in logic: evidence, probability, relevance, reasonableness, precedent, presumption, proof, explanation, plausability, etc. That legal outcomes are not always considered reasonable may be due more to the fallibility of a judge, jury, expert or process. Further, drafting a legal document and programming are not that disimilar.