20

I'm a new student of C language and I often browse Stack Overflow to answer questions related to that language specifically. But, sometimes, an OP posts their entire code and wants someone to debug it. The code has a lot of issues, not only technical, but also logical ones.

When I try to advise someone about that and recommend fixes that aren't just: "Hey, change that line for this", I get downvoted.

Should I stop advising and focus only on correcting other people's code?

12
  • 27
    Generally speaking: please don't stop giving that kind of advice! It's given way too rarely on SO, as many people are indeed just there for the points. Can you point to some contributions of yours that weren't well received? Perhaps we can give some hints on how to structure them differently so they get a better reception.
    – Pekka
    Jan 15, 2017 at 18:20
  • 25
    And for the record, when people post just code and want it debugged, it is perfectly okay to flag e.g. as "too broad" (you will be able to vote to close yourself once you reach 3000 points) and also downvote. Those kinds of questions are understandable on a human level, but the community can't deal with too many of them - they're boring and useful usually only to the asker, not future generations of googlers.
    – Pekka
    Jan 15, 2017 at 18:21
  • 16
    It's not clear to me exactly what type of answers you're describing—or if they're even answers at all. Are you posting answers or comments? If you're posting answers, do they actually contain the answer to the question, in addition to whatever other advice you may have? Can you maybe give us an example (link) of some of the answers you're talking about? Jan 15, 2017 at 18:23
  • 7
    You need to make sure that you do actually answer the question then you can add some other advice on other issues you notice. If you just profer advice on tangential issues this is likely to be downvoted. Jan 15, 2017 at 19:05
  • 3
    Once you decide that a question is actually worth answering you need to actually answer it. You do not have to provide fully working code or exhaustive explanations but you can't just give a hint as the answer. Hints are for comments.
    – PM 77-1
    Jan 16, 2017 at 0:01
  • 3
    Answering bad questions doesn't make you a bad answerer! On the other hand, it's probably a better use of your time to just comment, down-vote, or vote-to-close. Jan 16, 2017 at 1:39
  • 2
    I think you haven't received 'comments' privilege yet. You need to work your way up to that privilege. Once you do, you can post your suggestions as comments instead of answers.
    – sid-m
    Jan 16, 2017 at 5:33
  • 1
    I dont know if it's coward from my part, but I usually delete my downvoted answers, because I think that I'm not helping, so why stay my answer there? So, I dont have a link for an example. But, I can resume one that motivated me to post this question: a guy was working with strings in C, but he was dealing with it really bad, maybe because he doesn't know data structure, and I suggested he to learn about a structure and his life would be really easier. Now I can see that this should be a comment, not an answer. Really thank you guys, sorry for the long comment. Jan 16, 2017 at 14:20
  • 1
    As some advice, the answers you're describing would be better suited and completely on-topic for Code Review. As others have said, since you're not answering the question, you're off topic here. However, that advice should always be desired.
    – krillgar
    Jan 16, 2017 at 15:38
  • 2
    The single most useless "answer" is the one that just fixes the problem without clearing up the underlying misconceptions that led to the problem in the first place. @GabrielPellegrino please stick to your guns and answer the questions properly. Remember that rep is useless - you can't spend it, you can't do anything with it - but actually helping someone is priceless. If the begrudgers mark you down, go ahead and add a line of "here's how to do what you're trying to do" Jan 16, 2017 at 16:34
  • 1
    I would down vote you regardless of the content of your answer. Good, bad or indifferent. SO is overwhelmed with rubbish questions like that and by answering, you are just encouraging them to ask more. So if you answer, then you are contributing to the problem. You will get down votes as punishment.
    – JK.
    Jan 16, 2017 at 22:57
  • 1
    On a side note, it's never a bad idea to put some effort into formatting your question properly so it's more easily readable. I did it for you here. Jan 18, 2017 at 8:53

1 Answer 1

53

Advice on code quality and style that don't answer the question should be comments.

  • such "the question posted it's entire code and want someone to debug" questions should not be answered and instead closed - most suitable reasons "no MCVE" (if asking for particular error but has many) or "too broad". You can comment on issues you've noticed if you want to.

  • if you post an answer it must contain answer to the question as asked. Answer may include additional sections with other recommendations. If you can't provide better answer than already present - it is better to not post an answer and move to another question.

Note: if you are more interested in overall quality of code - try to contribute on another SE site - http://codereview.stackexchange.com which focuses on reviewing correct code rather than answering one concrete question at a time.

2
  • I suppose you're right, sorry for my noob behavior. if you post an answer it must contain answer to the question as asked. I'll remember that. Jan 16, 2017 at 14:22
  • It's all about save your resources for question that realy need your resources. A good answer takes some time. A quick comment to point a developer into the right direction is much faster :) Jan 18, 2017 at 8:52

You must log in to answer this question.

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