12

Please have a look at this question and my answer to it. The first initial half of my answer address the OP's original problem and explains what's wrong there.

And at the very end, I've given the suggestion of how it could be done in a better way. Isn't this the proper way of answer a question? Or should I just ask the OP to directly use the better way, even without helping the OP with the original problem? It could be a homework/assignment or the OP may not learn the concepts he/she is supposed to if I directly ask the OP to use the better way.

Also, shouldn't solving the OP's original problem be the priority?! Alternates/suggestions are good, but shouldn't they take the back seat generally?! I may be missing something here, which is why I want to clarify it.

Note: I'm not worried about the downvotes to my answer, I just want to know, if what I've done is right or not?!

  • In my opinion it's the right thing. for me is more important understand the concept, learn how to do the things the right way – Emilio Gort Nov 5 '13 at 6:23
  • @EmilioGort - And that is what I feel is the whole objective of the StackExchange network. – SudoRahul Nov 5 '13 at 6:25
  • 1
    How is this any different to your question: Answering beyond the question's scope? – ben is uǝq backwards Nov 5 '13 at 7:11
  • 1
    It's very much different. That question was, should we answer beyond the question's original scope and this is, shouldn't answering the question's original problem be the priority? or should the alternates be the priority. – SudoRahul Nov 5 '13 at 7:13
  • The first question is about "are add-ons to the question good?" and this question is about "should alternates/add-ons be preferred over the original question?". – SudoRahul Nov 5 '13 at 7:15
  • And this question "I've answered beyond the questions scope, is this correct?" The answer of which is the answer to your previous question... – ben is uǝq backwards Nov 5 '13 at 7:15
  • Nope, this question is, shouldn't the alternates take a back seat and answering the OP's original problem be the priority. There is more than a subtle difference between the both. I never spoke of answering beyond the scope. Rather, I'm saying that the scope of the question should be addressed before providing the addons. – SudoRahul Nov 5 '13 at 7:17
  • 1
    In my experience the OP's code is often unsalvageable because the whole approach is inherently flawed. In such cases answering the question as asked encourages the OP (and anybody reading the question) to use the "fixed" version of their code instead of an acceptable solution. For me "We believe our mission as a company is to make the internet better" takes precedence over the OP's wishes. In some cases I think answering the question directly is harmful and one should only point out its flaws and propose a better alternative. – CodesInChaos Nov 5 '13 at 17:24
8

It's usually good to address the OPs original question. The OP (or visitors) may be in a situation where the alternative is not possible for them. I've certainly had many problems when a Google search turns up alternative solutions but none of them are feasible. In this particular case, I don't think the OP would ever be in a situation where the alternative doesn't work, but doesn't hurt to solve it as well; it's always good to mention the alternative. But try to address the original question first.

Also, shouldn't solving the OP's original problem be the priority?! Alternates/suggestions are good, but shouldn't they take the back seat generally?! I may be missing something here, which is why I want to clarify it.

Yes, it is the priority.

| improve this answer | |
  • 4
    I want to get a bit more clarity on it actually. Why is it just OK to solve the OP's problem?! And why isn't that the priority?! Alternates/suggestions are good, but shouldn't they take the back seat generally?! I may be missing something here, which is why I want to clarify it. – SudoRahul Nov 5 '13 at 6:17
  • @R.J They should take the back seat. I never said they shouldn't. – Manishearth Nov 5 '13 at 6:18
  • This question here in comment is more thought provoking than the original one. Please consider adding it to your original question – Hanky Panky Nov 5 '13 at 6:18
  • @HankyPanky - Thanks for the suggestion. I did that:) – SudoRahul Nov 5 '13 at 6:20
  • @Manishearth - Thanks for editing the answer as per the edit in my question. I would like to hear a few more views from many other folks before accepting an answer! :) – SudoRahul Nov 5 '13 at 6:58
2

From your comments in the linked answer ...

Giving a better solution should be secondary because, the OP may have constraints ...

I agree with this when looking at it from the OP's side. Solve the question within the scope defined by the OP. They may be dealing with a real world problem and not an academic one. And so they might not be able to accomplish their task the preferred way.

But there are 2 audiences here. One audience needs a solution that can work around constraints. The other needs a solution and they are not constrained.

So I would also include the "preferred" way as well so that future users with similar problems (and no constraints) can be aware of the preferred approach.

You could submit 2 answers.

  • One that fits the OP's needs
  • One that gives a more proper solution.

The OP could select one answer as the solution to their specific problem.

The community can upvote the preferred approach for the non-constrained.

| improve this answer | |
2

Solving the OP's original problem, and then providing a better solution or critiquing the OP's approach, is the ideal way to answer a Stack Overflow question.

I wouldn't worry about the downvoter. Downvoters sometimes downvote for reasons which have nothing to do with post quality.

| improve this answer | |
  • I agree to the first statement you made, which is what I followed. And as for the other statement, I wasn't really bothered about the downvotes(there is a note in my question, if you missed it by any chance). I just wanted to know, what would attract a downvote in a case, where I've answered the question in the best way I could(may be it could have been better and that is what I wanted to know). – SudoRahul Nov 5 '13 at 16:39
  • You are worried about the downvotes. Otherwise, you wouldn't have asked the question. – user102937 Nov 5 '13 at 16:41
  • I wanted to know what would attract a downvote in that answer, rather than, why the downvote. – SudoRahul Nov 5 '13 at 16:44

Not the answer you're looking for? Browse other questions tagged .