When answering a question in which the OP has run themselves down a bad path, one usually wants to "start over", and put them on the path they "should have done from the beginning."
If the OP is experienced in the area their asking about, or has begun to realize that their approach is messy, they (or at least I) very much appreciate having my ideas thrown away for better ones. I like to know when there's a whole different approach I hadn't considered.
On the other hand, for a newbie this isn't always most helpful. It may not be obvious over the internet, but if you try this face-to-face you'll see it's a fairly useless teaching technique -- it's much better to work with the OP's ideas, even bad ones, so they can see the natural consequences of the method's their choosing.
Another thing to consider is that someone who found the page from Google probably just wants the final answer and isn't interested in drawn-out elaboration of a dead-end technique.
What are good ways to get a helpful balance? Or to judge the needs of a particular asker?