2

I was answering a question and the OP was asking if their code was good and what they could do afterward. They were trying to create a Single Page Application without a framework. The code worked fine though and they had no issues. I told them in the comments not to post stuff like that on SO. I also flagged the question.
Was that the correct thing to do?

15
  • 2
    The question is off-topic here. A request about how the current code could be improved could be on-topic at Code Review if the code works. A request about "next steps" wouldn't be on-topic anywhere since it'd be opinion-based. Dec 28, 2020 at 17:40
  • I was asking if what I did was the correct thing.
    – samarmohan
    Dec 28, 2020 at 17:41
  • What flag did you raise? Dec 28, 2020 at 17:42
  • I raised the Opinion based flag. Should I have raised the Off Topic??
    – samarmohan
    Dec 28, 2020 at 17:45
  • 4
    Opinion-based is fine for something like that. Dec 28, 2020 at 17:45
  • So is what I did fine or what? Was the question good, bad, etc
    – samarmohan
    Dec 28, 2020 at 17:47
  • 2
    @samarmohan If the OP has already working code, and want's it to be reviewed for improvements, they can ask that here: codereview.stackexchange.com/questions Dec 28, 2020 at 17:51
  • 1
    Does this answer your question? Dealing with code critique requests — isn't "Too broad" too broad? Dec 28, 2020 at 17:52
  • @πάνταῥεῖ I am not talking about me. I was talking about another person. Anyways, thank you. I will bring that up next time!
    – samarmohan
    Dec 28, 2020 at 17:52
  • @samarmohan I changed my comment accordingly. Dec 28, 2020 at 17:53
  • 2
    Personally I'd wait with commenting/flagging until after you know if those are the right things to do. You don't want to chase people away who are asking a perfectly valid/on-topic question.
    – Ivar
    Dec 28, 2020 at 17:54
  • 1
    Can you guys please post those as answers so I can vote up and/or mark them as correct?
    – samarmohan
    Dec 28, 2020 at 17:55
  • 1
    "Is my code good" is definitely a codereview thing. Because if you answer "No" the next question is bound to be, "How should I make it better?" which is refactoring
    – Taplar
    Dec 28, 2020 at 18:28
  • Such questions belong on Code review if they are asking "Is my code good?"
    – 10 Rep
    Dec 28, 2020 at 18:34
  • 1
    Relevant: Guidance on migrating questions to Code Review Dec 28, 2020 at 18:36

1 Answer 1

4

My personal view is that "Is my code good?" or "What should I do next?" questions are either opinion based, or too broad, or both.

Code isn't good or bad. It either works or does not work. Debates can be had about efficiency, readability, etc, but those are specifics and specific questions should be made regarding them. Depending on how they are worded they could still potentially be closed as too broad or opinionated, but they would at the very least be more specific.

"What should I do next" indicates that the user hasn't scoped the issue down and is potentially having issues breaking the problem up into smaller tasks and tackling them. It could be potentially useful to make comments to try to encourage them to identify the problem(s) and break it down into smaller pieces to work on, but the result imho should still be that the original question would be changed to be more specific, or perhaps multiple questions created over time addressing the more specific issues.

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