Bingo!
In the abstract, I'm on the "never trying is worse" side, because at least you can learn something from failure.
However, discerning a lost cause is an important skill. Otherwise, you spend your whole life tilting at windmills.