Skip to main content
6 of 6
replaced http://meta.codereview.stackexchange.com/ with https://codereview.meta.stackexchange.com/

After editing many posts over time, I've come up with my own checklist for formatting posts:

(I'll edit this as more things come to mind)

Code

  • Any code must be indented (manually, CTRL+K, or the {} button in the editor), not formatted with <code>/<pre>. These tags often leave extra whitespace, and if used incorrectly, hides syntax-highlighting. If you're unsure if it's being used, click on "edit" to make sure.
  • If a long piece of code is surrounded by backticks and wraps to the next line, it is often helpful to remove the backticks and apply indentation so that it can stand on its own line. This is mainly un-ideal if the flow of the sentence can become disrupted by doing this.
  • If code appears right after a list (but doesn't belong to the list), then even if the code is indented, it will be rendered incorrectly. Either some important text (no fillers) should be added in between, or <!--- ---> must be added to fix this.
  • If code inside a list shows up improperly, then it wasn't indented enough. Code within lists must be indented by eight spaces (more spaces required for more nesting, but always check the preview to make sure it's being done right).

Blockquotes

  • A programming challenge description
  • Code not to be reviewed (i.e. code taken as reference)
  • Input/output
  • Pseudocode
  • Documentation
  • A large quote by someone
  • Optional (for answers): blockquoting the referenced code from the question

Lists

  • Questions can be numbered or bulleted
  • If "1)" is used for numbering, replace with "1." to properly format it as a numbered list item. However, if code will immediately follow (no text to put on the same line as the number), then it may not be ideal to change this. It doesn't have to be forced if it'll require noisier changes.

Noise (which I remove):

  • "Hi"/"hello"/"greetings"...
  • "Thanks"/"thanks in advance(d)"/"thx"...
  • "Here's my code:" (if it's obvious that it's the OP's code)
  • "EDIT:" (unless it's really needed)
  • "guys" (not a gender thing; it just sounds informal)
  • "Sorry for my English" (we know that not everyone speaks it well)
  • "I'm not sure if this belongs here" (we'll determine that)
  • "I was told to come here" (okay, good to know, but it's irrelevant)
  • "Please add [tag]" (the tag(s) can be added by someone if needed)
  • "Please let me know if you need more information" (this will be done if needed)
  • "How can I improve this code" (already implied on this site)
  • "0 downvote favorite" (copy/paste error; absolute noise)
  • Excessive caps, bold, italics, and large text (only emphasize what's really needed)
  • Use of backticks for anything but inline code (replace with other formatting)
  • Blatant tags in titles (such as "C++: sorting algorithm")

Syntax-highlighting

  • If something is formatted as code which isn't code (i.e. a program's output), then the following should be applied above the text to remove the syntax-highlighting:

      <!-- language-all: lang-none -->
    
  • If a post contains snippets of multiple languages, and the syntax-highlighting is mixed (i.e. JavaScript highlighting being applied to HTML code), then they should be fixed as such (depending on the languages in question):

      <!-- language-all: lang-js -->
    
      // JavaScript code...
    
      <!-- language-all: lang-html -->
    
      // HTML code...
    

Misc.

  • Appended improved code should be removed (see this)
  • Replies to a comment or answer should be removed (if added to the question or another answer)
Jamal Mod
  • 35.2k
  • 2
  • 54
  • 106