8

A lot of times we see simple logic based questions, like this one. They are generally posted by people very new to programming, and do not know some very basic concepts (arrays, pointers, loops etc). I am sometimes tempted to comment that they should first follow a tutorial or book, but it would be rude(?).

  • They are (probably) not duplicates, on-topic, and the OP has done some effort in it.
  • They have provided explanation of the code and both are clear.
  • They are just missing a little detail or doing something (small) subtly wrong.

How should we deal with this?
I see that they are often downvoted, but in here, the top voted answer is perfectly against this one.

On one hand, the question is unlikely to be helpful to many other people because it is so small and specific. Also, it can be argued that they could have found the error by using a debugger, or just going through the code better (Rubber Duck). It can also be said that if they had gone through online resources and documentation, they would have solved it.

On the other hand, again, they have written the code, they (may) have researched it, but either did not know how to look, or where to look (They are new to programming). They do not have enough experience of "googling the error" and trying out possible solutions or linking that problem to their own. They do not know many common problems and how to avoid them.

But again, the point is that we cannot be sure if they have tried to solve their problem.
They might just be lazy! I say this because I rarely see references in these posts.

I was reading up on the many questions and the long discussions when this question was closed. I actually wanted to post this as an answer, but here goes:


Even after reading all the material and discussion, I am confused.

I still do not understand why this question is bad. It has currently been closed as off-topic.

Let's go over it from the Help Center:

Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. See: How to create a Minimal, Reproducible Example.

  • Desired Behaviour: Sure. We need to add those numbers with every digit > 5.
6978, 9, 66, 89, 76, 96

are all valid and are to be added.

6907, 681, 199, 959, 5

are all invalid and are to be skipped.

  • A Specific Problem: The problem is that they are getting the wrong output.
  • Shortest code which Reproduces the Error: I believe so. It is 40 lines long, but mostly due to bad formatting. The code is still short and clear (IMO). And it reproduces the error.

Note that I am specifically using the top post as the reference.

Please forgive me if I am being thick, but I feel this is a very borderline case. As long as I don't understand the tipping point, I (and possibly others) cannot meaningfully contribute to this site.

And please, no meta effect!

11
  • 7
    There never has been nor should there be a rule or reason to dismiss "simple" questions. All we need is a question that is well asked, on-topic and answerable. Where it sits on the "simple"/"complex" scale is irrelevant.
    – rene
    Dec 22, 2019 at 10:27
  • @rene And well (Stack Overflow) researched? :-) Also, this doesn't seem to be the general case (though I might be wrong). Dec 22, 2019 at 10:29
  • 2
    It is subjective what is well asked and well researched. That makes you can't determine the general case on observation alone. Also differs somewhat per tag.
    – rene
    Dec 22, 2019 at 10:37
  • Why do you say they're probably not duplicates? I'd expect the opposite... though the duplicate might be hard to find Dec 22, 2019 at 12:28
  • As a sidenote: Both answers you've linked are quite controversial (+24 -7, +450 -203), so the community is quite split on this ... Dec 22, 2019 at 12:34
  • That is why I cannot be sure. If they are difficult to find for experienced people, what hope do I have! Well, I suppose it eventually comes down to opinion (on implementing the rules designed to remove opinion), not (hard and fast) rules. The irony! Dec 22, 2019 at 13:55
  • 1
    We all start somewhere. Something that is "simple" for one person can be the complete opposite for someone else. Provided that it's still a good question, by showing sample code and replicates the problem, shows some form of attempt to resolve the problem (either failed code or research efforts) then I see nothing wrong. Now, if it truly is that simple there could easily be a good duplicate candidate; if that is the case then flag it or vote to close it as such. If there isn't an eligible candidate, then future readers with the same "simple" problem in the future now has an answer to it.
    – Thom A
    Dec 22, 2019 at 14:20
  • 2
    I am a beginner and frequently all I need is some guidance. SO is the best place to get an immediate response for any problem, other place is IRC channels. I ask on SO only when I have tried everything on the internet. I make sure to give every little piece of information for someone to be able to help me out, just like I tell my doctor about every symptoms :) . Be easy on beginners because they are just seeking guidance.
    – rsonx
    Dec 22, 2019 at 16:31
  • Related: meta.stackoverflow.com/questions/361215/… Dec 23, 2019 at 4:22
  • Related: meta.stackoverflow.com/questions/348485/… Dec 23, 2019 at 4:23
  • 1
    I generally give the benefit of doubt, don't worry. :-) I also hate it when people downvote without comment. How am I supposed to improve? Because no matter how much I research about What is a good question, I cannot put it to good use without some practice. We all know, practice makes perfect. Dec 23, 2019 at 9:49

1 Answer 1

4

Deal with simple logic-based questions in the same way as you would deal with any other ones. As rene suggested, "all we need is a question that is well asked, on-topic and answerable".

While this is true for many simple logic-based questions:

But again, the point is that we cannot be sure if they have tried to solve their problem. They might just be lazy!

...I believe we should assume the best intentions consistent with the facts. Here, let's assume that the OP has spent some effort before posting, and is new to the field, or just did not see an obvious issue, rather than being lazy. Many (not necessarily new) programmers from time to time get stuck on issues that are obvious only to a real person, rather than to themselves or even to a rubber duck.

Suggesting to use the debugger is not rude by itself, provided you solved the OP's question. Showing more than one way to debug the issue would be extra helpful. Even a simple print could go a long way - at least in the question you mentioned.

3
  • I was willing to give the benefit of doubt, and hence did not downvote the question. In fact, I provided an answer (suspiciously, both it and a previous question were downvoted without comment. What will I learn?). But please answer the update: Why is the top linked question "good" or "bad"? Dec 23, 2019 at 9:45
  • 1
    @JaideepShekhar The top linked question is good enough (acceptable) for SO, because it is helpful for more than just the OP. It can be useful, for example, for programmers who teach others or review the code to understand the types of bugs commonly found in the code of inexperienced programmers. BTW, I wish there was a tag for this, something like common-bugs-loops. Unfortunately, the meta effect caused the question to be closed. I would reopen the question. Dec 24, 2019 at 21:00
  • I don't know... Sometimes I feel SO has a split personality... Thanks anyway for the clarification. It was bugging me for some time. Could you add this part that it was valid to the answer? Dec 25, 2019 at 14:07

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