The political stakes in the UK and the US are high, yet both countries have of late embraced impractical candidates with far-left ideologies. In the UK, those who voted for socialist Jeremy Corbyn as Labour leader, when he had little experience, may be ruing their decision after his failure to to put forward a strong case for the UK remaining in the EU. Meanwhile, in the US, Bernie Sanders supporters clung to their candidate even when his remaining in the race diverted Hillary Clinton from focusing on Donald Trump.

Finding a candidate who embraces your values is understandable, crucial even. But fervent idealism, which places support for a certain candidate above all practical consequences of that support, is foolhardy. According to ethicists, it’s also immoral.

“The purpose of voting is not to express your fidelity to a worldview. It’s not to wave a flag or paint your face in team colors; it’s to produce outcomes,” says Jason Brennan, a philosopher at Georgetown University and author of The Ethics of Voting. “If they’re smart, they’ll vote for the candidate likely to best produce the outcome they want. That might very well be compromising, but if voting for a far-left or far-right candidate means that you’re just going to lose the election, then you’ve brought the world further away from justice rather than closer to it.”

Ilya Somin, a law professor at George Mason University, says it’s important for voters to balance their principles with the consequences of their actions. He suggests creating an equation to multiply how much one favors a candidate by that candidate’s chances of having a positive impact.

In general, two broad schools of ethics have bearing on how votes are cast, according to Michael LaBossiere, a philosophy professor at Florida A&M University. Utilitarianism suggests that the best action is whichever creates the maximum happiness for the greatest number of people—i.e. it’s best to vote with an eye to the political consequences. On the flip side, a deontological approach argues that the action itself, rather than the consequences, has moral worth, and so it would be acceptable to, say, champion Sanders regardless of how this might affect long-term US politics.

“As a citizen, I have a duty to others because it’s not just me and my principles, but everybody,” says LaBossiere, who favors the utilitarian approach. “I have to consider how what I do will impact other people. For example, if I was a die-hard Bernie supporter, I might say my principles tell me to vote for Bernie. But I’m not going to let my principles condemn other people to suffering.”

What can get lost in strategic voting, however, is nuance—opting for the more practical candidate usually means opting for something closer to the status quo. That leaves limited opportunities for perspectives that fall outside party lines.

“You enter a polling booth, there’s a complicated decision floating around in your head, and the best you can say is, ‘I vote for Hillary Clinton,’ or ‘I vote for Donald Trump,'” says Eric Pacuit, a philosophy professor at the University of Maryland. “It’s very limited.”