You say it ruins it, but my in my opinion, that's exactly what makes SO valuable. Often, it's not just the asker of the question that's trying to solve X but asks how to solve Y. So when you search on how to solve Y, you might also find out a better way to solve X that doesn't involve solving Y.
And if you are really trying to solve Y, it's not hard to specify that in your question (I know I can solve X without solving Y, but I don't want to solve X, I want is to solve Y in this case). I wouldn't say "there's nothing worse" than that; it's a minor inconvenience.