Skip to content

Instantly share code, notes, and snippets.

@MattDMo
Last active October 3, 2020 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattDMo/ac388b14e1b918f3735f87b2c2e63327 to your computer and use it in GitHub Desktop.
Save MattDMo/ac388b14e1b918f3735f87b2c2e63327 to your computer and use it in GitHub Desktop.
Useful comments and stuff for Stack Overflow

Intro

This is a collection of useful links and Markdown-formatted common comments for use on Stack Overflow and potentially other Stack Exchange sites as well. These comments should be used in the following ways:

  1. for questions which are unclear/borderline/irreproducible/no MCVE, to guide the OP to fix those issues
  2. for questions which are off-topic/subjective/too broad, to guide the OP to reformulate them, or at least understand why they're likely to get closed, so OPs know what edits they need to make to get them reopened
  3. for questions which have serious issues and are unfixable, to constructively explain why to the OP
  4. for answers that have problems and should be expanded, edited, or closed/deleted

Useful Links

Common Comments

Comment field is 600 char max, including @ replies

If you are new to Python, why are you starting with Python 2? The Stack Overflow Python community overwhelmingly recommends starting with Python 3, as does python.org itself. Version 3 is the present and future of the language, while 2 has passed its end-of-life. In learning 2 first, you'll pick up many bad habits that will need to be corrected when you learn 3 (which you'll need to do eventually), so start with 3 first, then learn the differences in 2 later.

If you are new to Python, why are you starting with Python 2? The [Stack Overflow Python community](http://sopython.com) overwhelmingly [recommends](http://sopython.com/wiki/What_tutorial_should_I_read%3F) starting with Python 3, as does [python.org itself](https://wiki.python.org/moin/Python2orPython3). Version 3 is the present and future of the language, while 2 has passed its end-of-life. In learning 2 first, you'll pick up many bad habits that will need to be corrected when you learn 3 (which you'll need to do eventually), so start with 3 first, then learn the differences in 2 later.

From Martijn Pieters ♦, the foremost Python expert on Stack Overflow: "Use Python 2 only when you need it for legacy reasons. New projects should use Python 3."

From [Martijn Pieters ♦](https://stackoverflow.com/users/100297), the foremost Python expert on Stack Overflow: *`"Use Python 2 only when you need it for legacy reasons. New projects should use Python 3."`*

Questions seeking debugging help ("why isn't this code working?") should include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it as formatted text in the question itself. Questions without a clear problem statement are not useful to other readers. See: [mre].

Questions seeking debugging help (**"why isn't this code working?"**) should include the desired behavior, *a specific problem or error* and *the shortest code necessary* to reproduce it *as formatted text* **in the question itself**. Questions without **a clear problem statement** are not useful to other readers. See: [mre].

Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. You may be able to get help on the [softwarerecs.se] Stack Exchange.

Questions asking us to **recommend or find a book, tool, software library, tutorial or other off-site resource** are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, [describe the problem](https://meta.stackoverflow.com/questions/254393) and what has been done so far to solve it. You *may* be able to get help on the [softwarerecs.se] Stack Exchange.

Stack Overflow is not a code-writing or tutorial service. Please [edit] your question and post what you have tried so far, including example input, expected output, the actual output (if any), and the full text of any errors or tracebacks, all as formatted text in the question itself. Do not post images of text.

Stack Overflow is not a code-writing or tutorial service. Please [edit] your question and post what you have tried so far, including example input, expected output, the actual output (if any), and the **full text** of any errors or tracebacks, all as formatted text in the question itself. Do not post images of text.

Stack Overflow is neither a forum nor a tutorial, code-writing, or homework service. This is a Q&A site where specific programming questions (usually, but not always, including some code) get specific answers. Please take the [tour] and carefully read through the [help] to learn more about the site, including what is on-topic and what is not, and [ask]. Please also follow the question checklist.

Stack Overflow is neither a forum nor a tutorial, code-writing, or homework service. This is a Q&A site where *specific* programming questions (usually, but not always, including some code) get *specific* answers. Please take the [tour] and carefully read through the [help] to learn more about the site, including [what is on-topic](https://stackoverflow.com/help/on-topic) and [what is not](https://stackoverflow.com/help/dont-ask), and [ask]. Please also follow the [question checklist](https://meta.stackoverflow.com/q/260648).

Here's a hint on asking questions: Put yourself in the mind of another person - someone you might ask the question to. Then, carefully re-read the question and ask yourself "Do I understand what is being asked? Is there any other information that might be necessary to answer it? Is it grammatically well-formed, spelled correctly, and punctuated - in English? Does it fit with the rules of this site as defined in the [help]?" If the answer to one or more of those questions is No, then you need to either work on your post some more or delete it. Please click the [edit] link to edit it.

Here's a hint on asking questions: Put yourself in the mind of another person - someone you might ask the question to. Then, carefully re-read the question and ask yourself *"Do I understand what is being asked? Is there any other information that might be necessary to answer it? Is it grammatically well-formed, spelled correctly, and punctuated - in English? Does it fit with the rules of this site as defined in the [help]?"* If the answer to one or more of those questions is *No*, then you need to either work on your post some more or delete it. Please click the [edit] link to edit it.

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the [ask] page for help clarifying this question.

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the [ask] page for help clarifying this question.

This should be a comment, not an answer - it does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. You can always comment on your own posts, and once you have sufficient reputation you'll be able to comment on all posts. See here to learn about this limit and what you should do instead. Comments posted as answers are subject to removal, or you can delete it yourself.

This should be a comment, not an answer - it does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. You can always comment on your own posts, and once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you'll be able to [comment](https://stackoverflow.com/help/privileges/comment) on all posts. See [here](https://meta.stackexchange.com/q/214173) to learn about this limit and what you should do instead. Comments posted as answers are subject to removal, or you can delete it yourself.

Please use the Post answer button only for actual answers. If you have a different question, please ask it by clicking the Ask Question button. If you have the exact same issue as this one, when you have enough reputation you can upvote the question or add a bounty on it.

[Please use the *Post answer* button only for actual answers](https://meta.stackoverflow.com/q/92107). If you have a **different** question, please ask it by clicking the [Ask Question](https://stackoverflow.com/questions/ask) button. If you have the exact same issue as this one, when you have enough [reputation](https://stackoverflow.com/help/whats-reputation) you can [upvote the question](https://stackoverflow.com/privileges/vote-up) or [add a bounty](https://stackoverflow.com/help/bounty) on it.

This was posted as an answer, but it does not attempt to answer the question. It should possibly be an edit, a comment, another question, or deleted altogether.

This was posted as an answer, but it does not attempt to answer the question. It should possibly be an edit, a comment, another question, or deleted altogether.

Next time, use Google to search for your question, and relevant answers on SO will appear at the top. Also, while you are composing your question, a list entitled Questions that may already have your answer shows up with potentially relevant questions. Use that list and open up the suggested questions in new tabs. This site has been around since 2008; if you suspect a question has already been asked, it probably has. Duplicates like this just waste time and effort.

Next time, use Google to search for your question, and relevant answers on SO will appear at the top. Also, while you are composing your question, a list entitled **Questions that may already have your answer** shows up with potentially relevant questions. **Use that list** and open up the suggested questions in new tabs. This site has been around since 2008; if you suspect a question has already been asked, it probably has. Duplicates like this just waste time and effort.

If this answer addressed your problem, please consider accepting it by clicking on the check mark/tick to the left of the answer, turning it green. This marks the question as resolved to your satisfaction, and awards reputation both to you and the person who answered. Once you have >= 15 reputation points, you may also upvote the answer if you wish. There is no obligation to do either.

If this answer [addressed your problem](https://stackoverflow.com/help/someone-answers), please consider [accepting it](https://meta.stackexchange.com/questions/5234) by clicking on the check mark/tick to the left of the answer, turning it green. This marks the question as resolved to your satisfaction, and awards [reputation](https://stackoverflow.com/help/whats-reputation) both to you and the person who answered. Once you have >= 15 reputation points, you may also upvote the answer if you wish. There is no obligation to do either.

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.

PLEASE DO NOT POST TEXT AS IMAGES. Copy and paste the text into your question and use the code formatting tool to format it correctly. Images are not searchable, and can not be interpreted by screen readers for those with visual impairments. Use the [edit] link to modify your question. See this for more information.

**PLEASE DO NOT POST TEXT AS IMAGES**. Copy and paste the text into your question and use the code formatting tool to format it correctly. Images are not searchable, and can not be interpreted by screen readers for those with visual impairments. Use the [edit] link to modify your question. See [this](https://meta.stackoverflow.com/a/285557/1426065) for more information.

While this code snippet may solve the problem, including an explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion.

While this code snippet may solve the problem, [including an explanation](https://meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers) really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion.

This issue was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting.

This issue was caused by **a problem that can no longer be reproduced** or **a simple typographical error**. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting [the shortest program necessary to reproduce the problem](https://stackoverflow.com/help/mcve) before posting.

Link-only answers are generally not acceptable on Stack Exchange sites. The link may change or become unreachable in the future, and without a summary of what the link contains this answer would be useless. Please summarize what is in the link (don't just copy and paste) and use the link solely for reference. If you remove the link and the answer cannot stand on its own, it is not a good answer.

Link-only answers are generally not acceptable on Stack Exchange sites. The link may change or become unreachable in the future, and without a summary of what the link contains this answer would be useless. Please summarize what is in the link (**don't** just copy and paste) and use the link solely for reference. *If you remove the link and the answer cannot stand on its own, it is not a good answer.*

Questions asking for homework help must include a summary of the work you've done so far to solve the problem and a description of the specific difficulty you are having solving it. Stack Overflow is not a homework service to complete your assignment end-to-end.

Questions asking for *homework help* **must include** a summary of the work you've done so far to solve the problem and a description of the *specific difficulty* you are having solving it. Stack Overflow is not a homework service to complete your assignment end-to-end.

Please don't answer opinion-based questions like requests for software recommendations. They are strictly off-topic. From [answer], "Not all questions can or should be answered here. Save yourself some frustration and avoid trying to answer questions which [...] solicit opinions rather than facts."

Please don't answer opinion-based questions like requests for software recommendations. They are strictly [off-topic](https://stackoverflow.com/help/dont-ask). From [answer], *`"Not all questions can or should be answered here. Save yourself some frustration and avoid trying to answer questions which [...] solicit opinions rather than facts."`*

From How do I write a good answer? in the [help], Answer well-asked questions. Not all questions can or should be answered here.

From [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer) in the [help], *`Answer well-asked questions. Not all questions can or should be answered here.`*

Please don't tag your IDE or code editor unless your question is specifically related to the editor itself.

Please don't tag your IDE or code editor unless your question is specifically related to the editor itself.

From What topics can I ask about here? in the [help], software questions are allowed if they cover "[...] software tools commonly used by programmers". Sublime Text, like vim, emacs, VSCode, etc., is a programming editor, and there are tens of thousands of questions about them on this site that are perfectly on-topic.

From [What topics can I ask about here?](https://stackoverflow.com/help/on-topic) in the [help], software questions are allowed if they cover *"[...] software tools commonly used by programmers".* Sublime Text, like vim, emacs, VSCode, etc., is a programming editor, and there are [tens of thousands of questions](https://stackoverflow.com/questions/tagged/sublimetext2+or+sublimetext3+or+sublimetext+or+vim+or+vi+or+emacs+or+visual-studio-code) about them on this site that are perfectly on-topic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment