40
\$\begingroup\$

On Code Review we often encounter questions with the same kind of problem over and over again.

Some of us are using the auto comments script which allows you to maintain a list of comments to post.

What are some useful tin-can comments that can be good to have in your list of comments?

If you feel that a comment can be improved, you can post a comment on that specific answer.

\$\endgroup\$

18 Answers 18

29
\$\begingroup\$

This is intended as a ready copy & paste version for including in the Auto-Comments script.

The Auto Comments script also has support for a "remote" feature where you can use this URL: http://www.zomis.net/codereview/auto-comments

###[Q] Broken Code
I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing *what* your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our [help center](/help/on-topic) for more information.

###[Q] Question contains no code at all / a link to code
Unfortunately your question is off-topic as of now, as the code to be reviewed must be [present in the question.](//codereview.meta.stackexchange.com/q/1308) Please add the code you want reviewed in your question. Thanks!

###[Q] Answers Invalidated
Please do not update the code in your question to incorporate feedback from answers, doing so goes against the Question + Answer style of Code Review. This is not a forum where you should keep the most updated version in your question. Please see *[what you may and may not do after receiving answers](//codereview.meta.stackexchange.com/a/1765)*.

###[Q] Description is behind a link
Links can rot. [Please include a description of the challenge here in your question.](//codereview.meta.stackexchange.com/q/1993)

###[A] Non-Review Answer
You have presented an alternative solution, but haven't reviewed the code. Please explain your reasoning (how your solution works and why it is better than the original) so that the author and other readers can learn from your thought process.

###[Q] Example Code
I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. The example code that you have posted is not reviewable in this form because it leaves us guessing at your intentions.  Unlike Stack Overflow, Code Review needs to look at concrete code in a real context. Please see [Why is hypothetical example code off-topic for CR?](//codereview.meta.stackexchange.com/q/1709)

###[Q] Bad Title
The current question title, which states your concerns about the code, applies to too many questions on this site to be useful. The site standard is for the title to simply state the task accomplished by the code. Please see [ask] for examples, and revise the title accordingly.

###[Q] Question lacks description
This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. [Questions should include a description of what the code does](//codereview.meta.stackexchange.com/q/1226)

###[Q] Question containing code from someone else
Unfortunately, this is not code you own or maintain. [For licensing, moral, and procedural reasons, we cannot review code written by other programmers](//codereview.meta.stackexchange.com/questions/1294).

###[A] Answer which is a question
This isn't an answer to the question. If you have another question, please ask it by clicking the [Ask Question](/questions/ask) button. If you are uncertain, take a look at [ask].

###[Q] Question contains code, but hidden behind a link
Unfortunately your question is off-topic as of now, as the code to be reviewed must be [present in the question](//codereview.meta.stackexchange.com/q/1308). Code behind links is considered non-reviewable. Please add the code you want reviewed in your question. Thanks!

###[Q] Generic Best Practices
Generic best practices are outside the scope of this site. Please [**follow the tour**](//codereview.stackexchange.com/tour), and read [**"What topics can I ask about here?"**](//codereview.stackexchange.com/help/on-topic), [**"How do I ask a good question?"**](//codereview.stackexchange.com/help/how-to-ask) and [**"What types of questions should I avoid asking?"**](//codereview.stackexchange.com/help/dont-ask).

###[Q] New user asking for code  
Unfortunately, we don't provide code, we review code you've written. Depending on your problem, another site of the [Stack Exchange network](//stackexchange.com/) can help you. Please see our [help/on-topic] for more information.

###[A] Good post by a new user :-)
Thanks for this great answer - I hope to see more from you in future!

###[Q] Good post by a new user :-)
Thanks for this great question - I hope you get some good reviews, and I hope to see more of your contributions here in future!

[Q] comments are available on questions, [A] comments on answers.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ For those interested in having all of those in one easy copy-paste place, see this other answer. \$\endgroup\$
    – Phrancis
    Nov 4, 2017 at 18:32
19
\$\begingroup\$

Question contains non-working code.

Welcome to Code Review! I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing *what* your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our [help center](/help/on-topic) for more information.

This comment makes our site scope much clearer, and is an invitation for the user to come back once the code works and get the full usage of Code Review.

\$\endgroup\$
16
\$\begingroup\$

OP has edited their question to include feedback received in answers, effectively invalidating existing answers.

Adapted from the famous meta post, "For an iterative review, is it okay to edit my own question to include revised code?":

I have rolled back the last edit. Please see *[What to do when someone answers](/help/someone-answers)*.

The answer-invalidating edit should be rolled back, too.

If you don't have editing rights, you can use the comment below and flag for moderator attention.

Please do not add, remove, or edit code in a question after you've received an answer. The site policy is explained in [What to do when someone answers](/help/someone-answers).

Another version:

Please do not update the code in your question to incorporate feedback from answers, doing so goes against the Question + Answer style of Code Review. This is not a forum where you should keep the most updated version in your question. Please see *[what you may and may not do after receiving answers](//codereview.meta.stackexchange.com/a/1765)*.

Beginner friendly variant (after you rolled changes back):

While it's great that a review enabled you to improve your code, please do not update the code in your question to incorporate feedback from answers. Doing so goes against the Question + Answer style of Code Review, as it unfortunately invalidates the existing review(s). This is not a forum where you should keep the most updated version in your question, so I rolled your changes back to the previous version. Please see see *[what you may and may not do after receiving answers](//codereview.meta.stackexchange.com/a/1765)* for ways to announce your new code.

\$\endgroup\$
1
  • \$\begingroup\$ I'd recommend changing the wording in the last one -- "goes against the Question and Answer style" is pretty vague and not very satisfying. "It invalidates the answers people have provided or are working on, which goes against [etc.]" would be better IMO, because it provides a clear reason that, honestly, stands up on its own. \$\endgroup\$
    – Nic
    Mar 9, 2018 at 19:39
14
\$\begingroup\$

Question contains Hypothetical Code / Pseudocode

I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. The example code that you have posted is not reviewable in this form because it leaves us guessing at your intentions. Unlike Stack Overflow, Code Review needs to look at concrete code in a real context. Please see [Why is hypothetical example code off-topic for CR?](//codereview.meta.stackexchange.com/q/1709)

\$\endgroup\$
12
\$\begingroup\$

An answer contains a completely different solution with no explanation or justification.

You have presented an alternative solution, but haven't reviewed the code. Please explain your reasoning (how your solution works and why it is better than the original) so that the author and other readers can learn from your thought process.

In addition, please flag the post as low quality. Moderators may put an "insufficient explanation" notice on it, and we can keep track of such posts for deletion in the future if no improvement is made.

\$\endgroup\$
4
  • 6
    \$\begingroup\$ Another version of this that I have used: Although this answer provides an alternative way of implementing what the OP wants, commenting on what things you do differently, why you are doing it that way and pointing out the flaws in the OP's original code would make this a better answer. Copy-pasting code does not always provide a good learning experience. \$\endgroup\$ Jan 14, 2015 at 17:29
  • \$\begingroup\$ maybe we could also link here \$\endgroup\$
    – Vogel612
    Jan 14, 2015 at 17:29
  • \$\begingroup\$ How to I flag as "low quality"? That's not an available option in the flagging dialog. Should I flag such an answer as "in need for moderator intervention"? \$\endgroup\$
    – Martin R
    Aug 24, 2017 at 17:47
  • \$\begingroup\$ @MartinR Either "not an answer" or "in need of moderator intervention" would work. \$\endgroup\$ Aug 24, 2017 at 18:01
11
\$\begingroup\$

Title is too generic

The desire to improve code is implied for all questions on this site. Question titles should reflect the purpose of the code, not how you wish to have it reworked. See [ask] for examples.

Another wording:

The current question title, which states your concerns about the code, is too general to be useful here. The site standard is for the title to simply state the task accomplished by the code. Please see [ask] for examples, and revise the title accordingly.

Also feel free to edit the title and make it awesome. A good title can often become a hot question.

\$\endgroup\$
1
9
\$\begingroup\$

I like all of these in one single place!

I put together and am actively maintaining a list of easily usable copy-paste responses on Github, which everyone is free to use, copy and clone as they please. They are inspired by the responses found here.

I made that because I find it easier to keep it organized and up-to-date this way, rather than trying to maintain answers to this post. Feel welcome to help yourself to it.

License is WTFPL.

\$\endgroup\$
0
8
\$\begingroup\$

Code Challenge Missing Description

Links can rot. [Please include a description of the challenge here in your question.](//codereview.meta.stackexchange.com/q/1993)

\$\endgroup\$
7
\$\begingroup\$

Question contains little to no description about what the code does.

This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. [Questions should include a description of what the code does](//codereview.meta.stackexchange.com/q/1226)

\$\endgroup\$
7
\$\begingroup\$

Question asking for help understanding code

Unfortunately this question appears to be off topic because it is about understanding code. [The point of a code review is to identify things about the code that can be improved and discuss possible improvements](//codereview.meta.stackexchange.com/q/198).

\$\endgroup\$
7
\$\begingroup\$

Question contains no code at all

Unfortunately your question is off-topic as of now, as the code to be reviewed must be [present in the question.](//codereview.meta.stackexchange.com/q/1308) Please add the code you want reviewed in your question. Thanks!

Question contains code, but hidden behind a link

Unfortunately your question is off-topic as of now, as the code to be reviewed must be [present in the question.](//codereview.meta.stackexchange.com/q/1308) Code behind links is considered non-reviewable. Please add the code you want reviewed in your question. Thanks!

\$\endgroup\$
0
5
\$\begingroup\$

Answer which is asking for clarification

This is really a comment, not an answer. With a bit more rep, [you will be able to post comments](/privileges/comment). For the moment I've added the comment for you, and I'm flagging this post for deletion.

\$\endgroup\$
2
  • \$\begingroup\$ Now that I think about it anyone can do the moderator version. I cannot transform answers into comments, but I can copy+paste the answer as a comment and copy+paste your second text as a comment to the answer. That way the community is perceived as helpful instead of an obstacle. \$\endgroup\$
    – nwp
    Jan 22, 2015 at 11:12
  • 1
    \$\begingroup\$ This looks like one of those that are built into the Stack Exchange review system. \$\endgroup\$ Jan 22, 2015 at 11:29
4
\$\begingroup\$

Answer which is a question

This isn't an answer to the question. If you have another question, please ask it by clicking the [Ask Question](http://codereview.stackexchange.com/questions/ask) button. If you are uncertain, take a look at [ask].

\$\endgroup\$
8
  • \$\begingroup\$ This is good, but seems really similar to this one. Can they be merged somehow? meta.codereview.stackexchange.com/a/4955/41243 \$\endgroup\$
    – RubberDuck
    Jan 15, 2015 at 12:31
  • 3
    \$\begingroup\$ @RubberDuck, I think it should stay on its own. This is in the range of "Hey pretty good code, but I have a question about xyz". \$\endgroup\$
    – Heslacher
    Jan 15, 2015 at 12:32
  • \$\begingroup\$ When I started (on SO) I wanted clarifications to the question, but did not have enough rep to write a comment. So I had to write it in an answer, which is wrong. Then people commented I should write a comment instead, which I could not. I see it as a problem that people try doing the right thing, but are prevented by the system and then mocked by unobservant people (sadly, mostly moderators). Moderators should turn such answers into comments, but not everyone has mod rights, so take a second look at the answerer's rep before copy+pasting the above text and similar for a comment. \$\endgroup\$
    – nwp
    Jan 22, 2015 at 10:50
  • 1
    \$\begingroup\$ @nwp Did you read the header ? -> Answer which is a question \$\endgroup\$
    – Heslacher
    Jan 22, 2015 at 10:52
  • \$\begingroup\$ I did. "What do you mean by foobar?" is one of those answers which are questions. Clearly "Good code, but I have a question about xyz" is a different type of answer which is a question. I just want people to pay more attention when copy+pasting comments, because it really sucks when they get it wrong. \$\endgroup\$
    – nwp
    Jan 22, 2015 at 10:57
  • \$\begingroup\$ For the asking about clarification we have This is really a comment, not an answer. With a bit more rep, [you will be able to post comments](http://meta.codereview.stackexchange.com/privileges/comment). \$\endgroup\$
    – Heslacher
    Jan 22, 2015 at 11:00
  • \$\begingroup\$ @nwp Added version about clarification meta.codereview.stackexchange.com/a/4998/29371 \$\endgroup\$
    – Heslacher
    Jan 22, 2015 at 11:04
  • \$\begingroup\$ Already handled by review. \$\endgroup\$ Feb 13, 2018 at 11:32
4
\$\begingroup\$

New user asks for code

Unfortunately, we don't provide code, we review code you've written. Depending on your problem, another site of the [StackExchange network](//stackexchange.com) can help you. Please see our [help/on-topic] for more information.

\$\endgroup\$
3
\$\begingroup\$

A Stack Overflow user recommends Code Review

Off-topic question

Generic

Unfortunately, this question would be off-topic on Code Review, see [the migration guide](https://codereview.meta.stackexchange.com/a/5778/21002) or [the on-topic section](https://codereview.stackexchange.com/help/on-topic)

New feature

Unfortunately, this question would be off-topic on Code Review, see [the migration guide](https://codereview.meta.stackexchange.com/a/5778/21002) or [the on-topic section](https://codereview.stackexchange.com/help/on-topic). OP asks how to implement a new feature, and not yet written code is off-topic on Code Review.

Code not working

Unfortunately, this question would be off-topic on Code Review, see [the migration guide](https://codereview.meta.stackexchange.com/a/5778/21002) or [the on-topic section](https://codereview.stackexchange.com/help/on-topic). OP's code does not yet yield the desired behaviour, and code not working ass intended is off-topic on Code Review.

Explanation of existing code

Unfortunately, this question would be off-topic on Code Review, see [the migration guide](https://codereview.meta.stackexchange.com/a/5778/21002) or [the on-topic section](https://codereview.stackexchange.com/help/on-topic). OP asks how the code works, however, third party code is strictly off-topic on Code Review.

\$\endgroup\$
2
\$\begingroup\$

Question can be improved - Guide for good questions

Your question currently leaves some things to be desired. I'd recommend taking a look at [Simon's Guide to posting a good question](//codereview.meta.stackexchange.com/a/6429). In particular, you could improve {todo}.

Don't forget to fill in the {todo} part. Or scrap it completely.

\$\endgroup\$
2
\$\begingroup\$

Question asks for an explanation of code

Unfortunately this question doesn't reflect what the site is about. We review code that you have written for improvements. It's not on topic to ask for explanations of code that has been written by someone other than you. For more information, see the [help/on-topic]. Thanks.

\$\endgroup\$
1
  • \$\begingroup\$ " that has been written by someone else than you" - so... if it's my own code that I wrote whilst drunk...? \$\endgroup\$
    – Pimgd
    Jul 12, 2016 at 11:41
1
\$\begingroup\$

Welcome a good first-time poster

Let's be supportive when people get things right early on. :-)

###[A] Good post by a new user :-)
Thanks for this great answer - I hope to see more from you in future!

###[Q] Good post by a new user :-)
Thanks for this great question - I hope you get some good reviews, and I hope to see more of your contributions here in future!
\$\endgroup\$
1
  • 2
    \$\begingroup\$ Perhaps add a note about when such comments should be removed. After a week? \$\endgroup\$ Jun 24, 2022 at 10:56

You must log in to answer this question.

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