P(Cause and Effect) = P(Cause) × P(Effect given Cause) = P(Effect) × P(Cause given Effect)
so P(Cause) = P(Effect) × P(Cause given Effect) ÷ P(Effect given Cause)
P(Cause and Effect) = P(Cause) × P(Effect given Cause) = P(Effect) × P(Cause given Effect)
so P(Cause) = P(Effect) × P(Cause given Effect) ÷ P(Effect given Cause)
P(A and B are both true) = P (A is true) x P (B is also true, given that we know A is already true) = P (B is true) x P (A is also true, given that we know B is already true)
I thought it'd be better to make it easier to understand (and more practical) by showing how it helps you infer causes from effects.
ADDED. Explanation: hearing squeaking noises in the night is evidence for the hypothesis that the cheese will have bite marks on it when we look in the morning (in the sense that the squeaking noises increase the probability of the bite-mark hypothesis) even though the squeaking noises do not cause the bite marks nor do the bite marks cause the squeaking noises. You and I know that the squeaking noises and the bite marks have the same underlying cause, but Bayes's rule is useful in situations where cause-and-effect remain unknown. E.g., it can be used by a space alien without knowledge of mice who cannot afford to ponder on the possible causes of the bite marks and the squeaking noises.
As a bonus, others will easily be able to understand and fix or extend the code.