Let's not be soo biased and say both partners should know better and not compare.
It's human nature to compare. We compare products, prices, lifestyles, options, what have you. But verbally comparing ur spouse to an ex especially in an unfavorable way....is going to be hurtful. Know what I mean? Things can be worded in a way that makes them sound more like suggestions as opposed to a comparison.
In my post, yes, I used a husband as a humorous example......but prior to that I said "why would a married partner knowingly compare?" I used the word** partner** to refer to both husband and wife.