That's a horrifically regressive view on this. Why should the person being harassed have to leave? Why can't the person doing the harassing be forced out? And saying that leaving quietly is "handling it gracefully" puts the entire burden on the victim, as if not just graciously accepting someone's sexual advances is causing a nuisance to the rest of the company.
If you expect all women who are the victims of sexual harassment to leave their jobs without making a fuss, you can't be surprised when people write long thinkpieces on the software industry is lacking in female representation.