3

Pleas have a look at this question. The OP wants to know why declaring variables globally didn't work in that case. In the sense, the OP tried it but it didn't work. If you look at the accepted answer for the question, it gives the solution by declaring those 2 variables as static. That's correct and I've no problem with it. But it really does not explain anything related to why those 2 variables must be static. On reading closely, we know that the OP tried global declaration, but since static keyword was not used it didn't work. Therefore, the explanation regarding the usage of static should have been there.

I know that the OP accepted the answer, so he/she is fine with it, even without the explanation of static. But tomorrow, some other use comes with the same problem, will see the accepted answer, and goes back thinking just giving static and putting it outside all the methods will do the trick, even without knowing, why static was used in the first place.

My question is, what should be done in such a case? Just let it be as such, or, may be I should go and edit the answer(that would like a massive edit to the answer, since it has no explanation about static to start with), or what else can be done in such a case?

P.S: I'm not asking this because the OP didn't accept my answer. I don't mind that at all. I just wanted the accepted answer to explain what the problem was, why it occurred and why the given code solved it. Also, it doesn't look good if I approach the OP saying, the answer you accepted is wrong. Accept mine. It would make the guy whose answer was accepted start hating me.

So any suggestions on what can be done?!

  • Why not add your own answer with this detail – Richard Tingle Oct 19 '13 at 17:56
  • I already did that. Just that most people won't tend to look at other answers when the accepted answer, solves the problem. The question here is, should the answer just give the solution and not the reason?! – SudoRahul Oct 19 '13 at 17:58
  • Im not sure it's appropriate to "steal" the accepted tick for your owm answer, thats not the answer the OP accepted. They may well swap the accept to your answer – Richard Tingle Oct 19 '13 at 17:59
  • 1
    That's why we have the suggested edits and edits features on questions and answers - you can add such details, though reviewers of a suggested edit are likely to decline as a radical change. As @Richard said - add your own and hope that it will end up rising to the top. If you feel strongly enough, add a comment to the other answer and ask for those details - you never know, the person who answered may very well do so. – Oded Oct 19 '13 at 18:01
  • I don't want my answer to be the accepted answer. If there is any other answer explaining that as well, I don't mind it being accepted. I just wanted the answer to be actually helpful. – SudoRahul Oct 19 '13 at 18:02
  • Related: meta.stackexchange.com/a/189424/140505 – Oded Oct 19 '13 at 18:03
  • The problem is that you might not be right. I'm sure you think you are, and you probably are, but you might not be. So pushing your answer into the accepted spot; effectively without the OP's oversite could lead to odd situations – Richard Tingle Oct 19 '13 at 18:04
  • 1
    @Oded - So you suggest I post a comment to the answerer to edit his answer to explain why static, or something of that sort?! – SudoRahul Oct 19 '13 at 18:05
  • @RichardTingle - Yeah, that's a problem here. That's why I insisted, that I don't necessarily want my answer to be the accepted one. Anyways, I think I'd post a comment to that answerer, and hopefully, he'll edit his answer. – SudoRahul Oct 19 '13 at 18:07
  • @R.J - Absolutely. You can phrase it as "In order to make this answer the best it can be, could you please add ...?". – Oded Oct 19 '13 at 18:07
  • @Oded- That's a cool suggestion. Let me try that out. In case the answerer doesn't respond, can I make the edit myself? The reviewers declining my edit to the answer doesn't come into the pic as I've enough rep to make a direct edit, but I feel it might be abusing the privileges granted to me :( – SudoRahul Oct 19 '13 at 18:10
  • @R.J - The answer OP may end up not liking the change and rolling back, but then again that's their right. Personally, if I see an edit that made one of my answers much better, I would let it stand. – Oded Oct 19 '13 at 18:15
  • Done that. Waiting for the edit from the answerer. :) – SudoRahul Oct 19 '13 at 18:15
  • It worked!:) The answer OP is gonna accept the answer. Wish I could accept @Oded's comment as my answer. :'( – SudoRahul Oct 19 '13 at 18:18
  • 3
    Well, what do you know. Someone being reasonable on Stack Overflow! – Oded Oct 19 '13 at 18:20
10

The stack exchange sytem is one of competing answers, if you think existing answers are missing details add your own answer and let the voters decide or add a comment suggesting the change.

Ultimately the accepted answer may not be the best one, its just the one that helped the OP the most. Making large changes to the accepted answer, just because it is the accepted answer, pollutes the meaning of the accepted answer.

Additionally, you might not be right. I'm sure you think you are, and you probably are, but you might not be. So pushing your answer into the accepted spot; effectively without the OP's oversite could lead to odd situations.

Hopefully of course the OP will change their accept to your answer, but that is up to them.

  • 1
    That's the point here. No matter how many upvotes I guess, the accepted answer stays at the top, and any future reference to that question, the referrer will refer the accepted answer first, and it solves his problem, he'll walk back without even seeing the other answer. His problem might be solved, but he won't know, how it solved etc. – SudoRahul Oct 19 '13 at 17:59

You must log in to answer this question.

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