30

Question: Assuming that I found a question, and the owner of it has no idea about a specific question with clear description and few lines of codes. After a while, I got a feasible solution but I was not sure that it is the "best" one. In this situation, should I answer it or not?


I am a college student and a newcomer to Stack Overflow. After just viewing Questions and Answers for about a month, I began to answer some of them. Stack Overflow teaches me a copious amount of knowledge which can't be found in textbooks and I really appreciate it. However, I feel kind of awkward when someone else gives a better solution to a question, which makes my answer seems silly or naive. However, at that moment I will upvote the "best" one in my mind and delete mine, because I believe that Stack Overflow is a Q&A site for others with the same question and I don't want to mislead them. But such an option could be offensive when others leave helpful comments, even if they are just telling me not to do it. I can't thank them since it will not appear in their message box (the option of deletion also cleans the message box of the specific answer and there is nowhere else for me to leave a comment).


I checked the tag and searched "not the best answer" on meta. The most related question is this one, but I gave a specific answer, not a hint or a clue. Besides, I am not asking about any specific question on Stack Overflow, but still confused about whether I was wrong in answering a question or not. Actually, the feeling of awkwardness due to someone else's better answer is not normal to me (it happened 2 times, but I only gave 35 answers), and I got 1 upvote with 1 downvote on my most recent answer.

4
  • 2
    Imho, you can answer unless you are already sure that there is a better solution (e.g., since there is already a better answer). If you are just unsure if there is a better alternative, then keep on answering.
    – BDL
    Mar 11, 2018 at 16:19
  • 1
    @BDL Got that, thanks! But to prevent awkwardness, I prefer not answer the question if the sense that it will not be the best is very strong, although it's hard to measure the "sense". Mar 11, 2018 at 17:03
  • 14
    One thing you should avoid doing is deleting answers. Even if there is a better solution, it's not necessarily feasible and easy to understand for all users. However, if your answer is an easier to understand and as you said "silly or naive", it may still be useful to newer programming students, like myself. Just because your answer isn't the best one, doesn't mean it's bad. There are always several different ways to go about problems, which is the beauty of programming. Mar 11, 2018 at 17:10
  • @KrishnanshuGupta Emmm, it is totally another aspect of view! Maybe add a disclaimer like "feasible but not efficient" will be all right. Haha. Mar 11, 2018 at 23:32

1 Answer 1

33

Definitely.

If you came to a solution you could save the time of the next person who has the same question.

If you have any concerns about your way of solving the problem, please communicate this in the answer too. The next person might not be able to identify the problems that may potentially arise from using the solution.

This way future readers have the possibility to decide for themselves if your answer applies to their problem, or if they need to keep searching.

I have done this myself a few times, and have received upvotes on such answers over time, which indicates to me that others have found them useful.

12
  • 2
    I prefer that people don't share information that isn't adequate, for any reason. We already have problems with people blindly c-n-p'ing answers without reading very bold security warnings, I doubt they would read the chaveat section.
    – Braiam
    Mar 11, 2018 at 19:25
  • 4
    Thanks! I agree wholehearted with the beauty of programming, and maybe I forget that StackOverflow is not only for the professional programmer who has to aim for efficiency. Mar 11, 2018 at 23:44
  • @Braiam Actually, I have the same concern with you. Answering without enough knowledge in the specific tag is also very irresponsible and awful to me. I'll ask myself twice about the adequately of my answer and judge them myself first, thanks! Mar 11, 2018 at 23:57
  • 2
    @Braiam So you prefer that people don't answer at all? The vast majority of code has significant caveats. I agree that in general, we should choose solutions that have as few limitations as possible, but especially in situations where there aren't simple general solutions, solutions that have major caveats can be extremely useful if your particular use case can limit itself to situations where it still applies.
    – jpmc26
    Mar 12, 2018 at 18:59
  • 1
    @Braiam Well, what do you mean by "adequate"? The kinds of answers Hunter is asking about, I would definitely characterize as adequate, and probably even better than that; their only failing is that they're not optimal. Of course we don't want people posting wrong answers, but as I understand it, that's not the issue here.
    – David Z
    Mar 12, 2018 at 20:01
  • @jpmc26 the chaveats are already contained in the question, no need to increase them even more by adding chaveats on the answers, when they aren't needed.
    – Braiam
    Mar 12, 2018 at 20:11
  • 2
    @Braiam LOL, no. Plenty of questions don't even have all the edge cases specified enough to even tell if a particular answer is applicable. I see them quite regularly. (Don't believe me? Look for questions about sorting or manipulating lists.) And often if you can exclude certain cases, you can present a vastly simpler solution. It's helpful to present it as long as the question doesn't make it not applicable explicitly. Also, when I Google "chaveats," I don't get any meaningful results. You should check your spelling.
    – jpmc26
    Mar 12, 2018 at 20:17
  • 1
    @Braiam Here's a nice example of exactly why you're wrong.
    – jpmc26
    Mar 13, 2018 at 5:36
  • @jpmc26 well, n=1 anyways. If it's like that, at least 40% of my programming problems are about edge cases. n is still 1 but, hey, I'm representative of my own point of view, and it proves you wrong.
    – Braiam
    Mar 13, 2018 at 11:24
  • 3
    @Braiam More like n = 28,000 some. Seriously, Braiam. Comments that misrepresent the reality in an attempt to create some kind of smug "gotcha" don't add anything to the discussion. I really wish you'd think your responses and your reasons for posting them through more.
    – jpmc26
    Mar 13, 2018 at 14:24
  • @jpmc26 28k vs 24 millions in other words 0.1166 percent. Not even 1% of all cases. See. Numbers!
    – Braiam
    Mar 13, 2018 at 15:07
  • 3
    @Braiam You're still trying to create gotchas, instead of thinking through what's being said. You asserted that I was using a sample size of 1, so I gave you some quick proof that this was clearly not an isolated incident. Your 24 million answers are not without caveats and limitation; they just don't use the word. Much further analysis is required to determine what sort of percentages contain "major caveats" (which we'd first have to define to begin with). But the kicker is it doesn't even matter what the percentages are. 10,000 useful answers with major caveats still proves the point.
    – jpmc26
    Mar 14, 2018 at 3:02

You must log in to answer this question.

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