There is a boundary between generations which is called the Intergenerational Boundary. This is a fundamental truism that I operate on when I see a family. Parents need to know what to share with their children and what they should keep to themselves.
Oftentimes after a divorce, or even after a big marital fight you're depressed, sad, or angry. And who's around? Your children - they're soft, pliable, loving, they'll listen and they'll be there, but sometimes they just shouldn't hear what you have to say.
It's very easy to break the boundary and count on your son or daughter. You may count on them as a substitute spouse, friend, or even worse, a therapist.
Another way that this boundary can be broken is if you're so angry at your ex that you want everyone around you, including your children to know what a jerk he has been. Do they need to know this? It may give you pleasure and you may even feel at ease after getting it all off your chest, but to poison a child's thoughts of their father or mother may have major affects down the road. Just because he wasn't the best husband doesn't mean he can't be a good father.
Children need to figure out for themselves what their relationship with their parents is. After 10, 20, or 30 years, they'll get it straight. If you deceive them and put your feelings onto them, not only will they lose out, but they may blame you as well. Hearing words like "how dare you deprive me of this?" is probably not an experience that you want to have.
The Intergenerational Boundary is a line in the sand. Respect it, so by and large your kids will do better, and so will you.