Stability of molecules by resonance I am pretty confused by some principles of resonance. Well by my study of electrostatics I know that potential energy of a system of  charges of same nature decreases as we increase the separation between them but same doesn't goes with a system of charges with different nature because their potential energy decreases as we decrease their separation as internal conservative forces do positive work.

I am a newcomer in chemistry so I have a doubt that my book says that energy of a molecule is minimum when they are separated by large distance (under the heading of application of resonance) without caring for nature of charges.This fact goes well for charges of same nature but contradicts the fact for system having different nature of charges.

Please tell me  that why this contradiction exists.
In chemical resonance, the same principle holds as in electrostatics:

"In general, the boundary structures of a conjugated system with the lowest energy are those
...
- in which the distance between charges of opposite sign is as small as possible and the distance between charges of the same sign is as large as possible
... ."

Wikipedia: Resonance (chemistry) - Major and minor contributors:
"Energetically unfavourable and therefore less favorable structures are minor contributors. With rules listed in rough order of diminishing importance, major contributors are generally structures that
...
3. carry a minimum of formally charged atoms, with the separation for unlike and like charges minimized and maximized, respectively
... ."