13

I just answered a question and as per being beaten into submission multiple times in the past by people editing my previous missives, I used back ticks to highlight some text. (See my answer here)

But what was interesting is that someone replied with the comment

It's not enough of a change for me to put an edit through, but code blocks are not for emphasis, and using them as such is detrimental to the Stack Exchange experience, especially for users of assistive technologies like screen readers. The backticks (`) should be replaced with single (') or double (") quotes

I had never considered this before. So what is the consensus on back ticks? What should I be using?

  • 2
    It's sad when somebody who is right gets beaten into submission by people who are wrong. So thanks for asking to clear this up! – David Richerby Nov 27 '18 at 14:46
29

Backticks create <code> blocks, which have a specific purpose in markup that is utilized on the technical stacks where actual computer code must be indicated, but less so on non-technical stacks such as this one. They should be used for code and code-like artifacts and not for highlighting.

It dirties the semantics of the network to use this markup in the interest of providing highlighted monospace text, which isn't even a standard way of formatting English. It makes the site unusable to people using assistive technologies. Besides, it's ugly.

You shouldn't use them for presentation. The markup here allows for boldface, italics, and blockquotes, size adjustments, and of course capitalization and punctuation. I like a clean, searchable site, as I think most do, so I use boldface for emphasis and italics for terminology or use-mention distinctions, and headlines where a long answer is benefited by headlines, and that has been entirely adequate.

  • 2
    It maybe that I came into all of this via stack overflow, so in going back there just now and looking at a random question I see multiple people using backticks to identify and emphasize non-code items inline. But now I consider myself educated on the matter and will refrain from using them in the future. I really had no idea that there rendered as code blocks – Peter M Nov 27 '18 at 2:18
  • Does it really mess up screen readers? Is there an example proving this? – JonathanReez Supports Monica Nov 27 '18 at 16:56
  • Does the average travel user know or care about all this? – user 56513 Nov 28 '18 at 10:22
  • 10
    @HonoraryWorldCitizen no, but a travel user using an assistive technology might. – ajd Nov 28 '18 at 17:42
  • 7
    @JonathanReez: It might. Good screen readers encountering a <code> block need to ensure that the user is given a completely unambiguous readout of every character (so that if you write something like &((*foo)->bar[7]), blind users can properly appreciate its monstrosity). A screen reader could choose to spell out one letter at a time instead of reading whole words, but there's no formal spec requiring it to do so. However, it does need to distinguish between foobar, FooBar, Foobar, fooBar, and foo_bar, so spelling out may be safer in the presence of mixed case. – Kevin Nov 30 '18 at 4:42
  • @Kevin again, that's just a conjecture. Have there been any actual complaints from persons with less than perfect sight about people using code blocks? – JonathanReez Supports Monica Nov 30 '18 at 5:49
  • 12
    @JonathanReez: Yes, there have been such complaints. See the notice across the top of the "makes the site unusable" link. – Kevin Nov 30 '18 at 5:55

You must log in to answer this question.

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