No matter how awful your previous employer was, no matter how terrible your boss was, no matter how evil your coworkers were, never ever burn your bridges behind you! I don't care if you were the victim of sexual harassment or threatened with human sacrifice—take it up with the courts, but do not take it out on your boss or coworkers in person before you leave. The "take this job and shove it" attitude will get you absolutely nothing except a temporary feeling of superiority. Even if you were treated unfairly, do not sink to their level to get even. The most respectable thing you can do (especially when it was rough) is to leave with honor and dignity. Keep your head up and keep your mouth shut. You will leave with respect instilled in your character rather than disgust instilled in your heart.
There is never a perfect time to leave one job for another.
And yes, burned bridges do come back to haunt you—in ways you least expect. I knew of one man who felt he had every right to tell his boss exactly what he thought of him—and did exactly that. Imagine his shock and horror when this former boss was hired by his new company over four years later—as his new boss! Needless to say, he lasted only a few months before he ended up leaving for another company. Another young woman who told off her boss when leaving the company found herself having to work with her less than a year later on a committee as part of her professional association.
Remember, no matter how large your geographical view of the world, it is a very small work world out there. Even if your former bosses never have any contact with you, they may very well talk about you (negatively) to others—sometimes at every opportunity they get. So keep it civil and professional.
Look forward, not backward. If you really want to throw them for a loop, sincerely thank them for all the help they have given you. Do your very best work in the time you have remaining with the company, and make them realize what a gem they are losing.