4

I've always used block quotes to display the resulting exception from code I need help with or something I didn't understand. But for some reason people always seem to edit them and put the exception inside a code block.

That is just seriously annoying, as it doesn't clarify or add value to the question. It seems to me that these are just unnecessary edits. As long as the edit isn't needed, the post should be left as it was by the asker.

I looked to see if there was some guideline for using them, but couldn't find any. So, I was wondering if this was some unspoken rule?

1
  • 1
    I'd recommend to put simple error messages in block quotes. If it's a complete stacktrace however I'd put it in a code block, because stacktraces in block quotes are not readable...
    – Floern
    Commented May 9, 2016 at 14:24

1 Answer 1

4

Error messages aren't code, no, so you shouldn't format them as code. Code formatting is for formatting code.

Block quotes on the other hand, as you said you use, tend to work poorly for stack traces as they wrap their content, and you don't actually want to wrap the lines when looking at a stack trace, as it makes it much harder to read. If you wrap the stack trace in <pre> tags it will leave the text as it is, not wrap the lines, but also not try to format it as code, use syntax highlighting, etc.

2
  • then why does alot of people seem to edit posts and format them as code it is really annoying, and after i revert the edit and put it back to the way it was they edit again, honestly this is starting to be alot like spamming
    – user1
    Commented May 9, 2016 at 14:15
  • 4
    We don't have a really good option for stack-traces and such. Using <pre>-blocks works if it doesn't contain html entities or <, otherwise a code-block with language-hint "none" often works better. Commented May 9, 2016 at 14:54

You must log in to answer this question.

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