33

This Meta question was suggested as providing an answer to this question:

But my question – this question – isn't about formatting (i.e. anything that would require ANY Markdown syntax to be parsed in question titles)!

(I even think my 'Markdown emphasis syntax' in this Meta question's title is fine. It doesn't need to be parse/formatted! Markdown is, by design, expressive even as raw text. It's also obviously possible for us to go overboard; I'm not defending or advocating for that.)

This is something I've noticed now a few times, people editing my questions to remove the backticks (or other syntactical characters) for Markdown-style inline code. Here's the latest question I've asked where this kind of edit was made:

Someone changed the title to:

"git log --stat" ...

Is there any reason why double quotes are better, e.g. clearer, more easily understood, than the backticks? To me, given how much I used Markdown, the backticks are more clearly code than regular quotes. (SO also seems to nicely format my commands when displaying the question title too – sometimes anyways.)

I would be shocked if there was some kind of, e.g. SQL injection risk, or other security or technical reason to avoid backticks. (That would also be extremely disappointing – sanitize your inputs people!)

30
  • 3
    Does this answer your question? Allow Markdown in question titles
    – cigien
    Commented Mar 14, 2021 at 17:42
  • 7
    @cigien It answers a similar question, but even if the Markdown isn't parsed by SO/SE for formatting the question titles in lists (or anywhere else), backticks still seem clearer, more readable, etc., than single or double quotes. Commented Mar 14, 2021 at 17:50
  • 22
    Oh, I see. You're not asking for markdown support, but just about using markdown syntax in titles. My bad, I've retracted the close vote. I'll leave the comment there for now, since it's a relevant link.
    – cigien
    Commented Mar 14, 2021 at 17:54
  • 1
    Well, I do think Markdown support is problematic. But Markdown syntax seems fine. I do prefer " to ` myself, but I don't think there's anything wrong with it, it's just a style preference. And I think I've used both styles previously in my own questions.
    – cigien
    Commented Mar 14, 2021 at 18:01
  • 11
    Personally, I do think " is better than ` in titles, but to edit your question just for that is completely unnecessary.
    – M-Chen-3
    Commented Mar 14, 2021 at 21:21
  • 4
    I’ve been editing a few titles from not using Markdown at all to using backticks. E.g., I’ve edited titles like “How do I do foo with my <p> tags?” to “How do I do foo with my `<p>` tags?”, mainly because I usually link to posts in the Markdown format [Title](Short URL with my user ID). In posts, long bare URLs are automatically rendered with the full title, and HTML and Markdown aren’t parsed. However, in Markdown links like mine, HTML and Markdown are parsed (and they get me the Announcer badge eventually). To avoid HTML tags getting parsed, I usually edit backticks around them. Commented Mar 14, 2021 at 21:36
  • 2
    By the way, is it intentional that you used 'syntax' in your title rather than `syntax`? Commented Mar 14, 2021 at 21:47
  • 5
    I think this should be reconsidered. I agree with the first comment by wilx on the answer of the duplicate post. Titles can be bad and distracting regardless of whether syntax formatting is allowed. A plain text title can be bad by using obnoxious symbols (">>>>>>>> HELP ME LOL! <<<<<<<<<<"). We don't ban the symbols though just because they can be abused. If someone abuses formatting, that can be edited out like anything else. There's multiple (many actually) times that I've thought that I could make my title more sensical by making it clear that a certain word is code, not normal text. Commented Mar 14, 2021 at 23:29
  • 1
    Backticks are specifically for code syntax highlighting. Code syntax highlighting isn't a thing in titles. QED, you shouldn't use backticks in titles.
    – TylerH
    Commented Mar 15, 2021 at 1:47
  • 2
    @TylerH That's incomplete. Markdown, and similar 'languages', are explicitly intended to be readable as-is: "A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.". Given that Markdown is now so ubiquitous, using 'Markdown syntax' is clearer, more readable (IMO), and thus better – even if it's NOT being used to generate "code syntax highlighting". (The highlighting is also new; formatting is the original purpose.) Commented Mar 15, 2021 at 14:19
  • 10
    What’s worse is that Stack Overflow does process question titles. Even though Markdown isn’t used, “smarty pants” processing is done — i.e. double dashes and quotes are replaced by long dashes and smart quotes; which is terrible on a programming website: your question doesn’t suffer from this, but if the title had been “git log -- path”, Stack Overflow would have falsified it into “git log – path”, which is just misleading. Likewise, automatically replacing straight quotes by smart quotes isn’t very smart at all. Unfortunately requests to fix this have been declined in the past. Commented Mar 15, 2021 at 14:51
  • 3
    @TylerH "Backticks are specifically for code syntax highlighting." This is patently false. Backticks in Markdown are for verbatim text (which is typically rendered in typewriter font), and I have never seen syntax highlighting applied to verbatim text in single backticks (it is only applied in code blocks). Commented Mar 15, 2021 at 21:39
  • 5
    Funny, nobody here has answered the actual question: "Is there any reason why double quotes are better, e.g. clearer, more easily understood, than the backticks?" -- I don't see a reason for one type of quote to be better than another. And I agree that the backticks convey an additional context understood by most users of SO. Commented Mar 15, 2021 at 21:48
  • 3
    @TylerH Did you know that people, human beings, often find creative ways to use things designed or built for different purposes? It's true! And it's also besides the point – Markdown was explicitly designed to be readable as-is, i.e. 'raw'. The markup syntax was designed to not only be parsed and rendered but to serve those same purposes even when it's not parsed or rendered. In _blah_blah is visually emphasized because of the surrounding _ characters. Rendering it is, or can be, nice, but it's not necessary or essential for the raw syntax itself to serve the same purposes. Commented Mar 16, 2021 at 15:55
  • 4
    @TylerH: Nah. Not everything on SO is written with the intention of being parsed by a hypothetical global Markdown renderer. Many titles are, yes, and some authors do get surprised that the rendering doesn't happen, yes, but not all. The backtick punctuation convention is shared in and out of Markdown and is generally recognized by a decent portion of readers. I don't exactly blame the editor for changing the title, but on the other hand, it still sticks out to me as change for the sake of change - either backticks or double quotes would've been acceptable.
    – BoltClock Mod
    Commented Mar 17, 2021 at 4:33

6 Answers 6

40

I would say that the need to add formatting to your title could be considered something like a "code smell": it's not guaranteed to be wrong, but may indicate that your title is trying to do too much.

Note that by "formatting", I don't just mean "rendered into HTML and styled by the browser", I mean anything that is there purely for visual effect - that includes Markdown-style punctuation, ASCII art, visually interesting Unicode symbols, etc

Because titles here are often framed as questions themselves, there's a temptation to make the title into the first paragraph of the question. But the role of a title is different: it should be easy to search for, easy to reference, and easy to read. Adding formatting may detract from that purpose - it might well be harder to read and/or harder to search for; but more importantly it distracts from it - it stops you looking for more creative ways to express the title.

For instance, you have a question where you've put so much information into the title, that you feel the main point isn't clear. You could add _underscores_ or *stars* (or ->pointers<- or ⚝fancy stars⚝...) around the important words to emphasise them. But you could instead delete the less important parts, and explain those details in the first paragraph. I think the second option leads to a clearer, more helpful title.

The example given of backticks vs quotes is definitely marginal, because they're closer to standard punctuation than pure visual effect, but a similar principle could apply: why is it necessary to delimit the command at all? For example, rather than adding backticks to the title "Error running some-command --some-option /var/blah --something --keep-going", you could use a title like "Error running some-command when I add --keep-going option". Again, the details of the other options may be relevant to answering the question, but that doesn't mean they need to be in the title.

13
  • 6
    How could I edit my question to make it clearer that, as I wrote in my question: "But my question – this question – isn't about formatting (i.e. anything that would require ANY Markdown syntax to be parsed in question titles)!". Markdown syntax was explicitly intended to be readable as-is, i.e. without being used for formatting. The big reason that I find it helpful to write, e.g. "Error running some-command when I add --keep-going option" (i.e with backticks) is that it's more precise. What is "--keep-going"? Why include the hyphens? Why not "'keep going' option"? Backticks are clearer. Commented Mar 15, 2021 at 14:24
  • @KennyEvitt By "formatting", I don't mean "rendered specially by the browser", I mean "existing only for visual effect". The underscores in the title of this page are not standard English punctuation, they are emulating underlining; that, to me, is formatting. I agree, and already said, that backticks are a marginal case; I don't personally see any need for them, and wouldn't bother, but wouldn't remove them, except if I was re-writing the title completely so that they became irrelevant.
    – IMSoP
    Commented Mar 15, 2021 at 15:41
  • 2
    All punctuation was non-standard originally. And we should expect punctuation to change, and for particular populations to have their own punctuation. Markdown is basically punctuation now for a lot of people, not just programmers. I think it's fine to accept it (without even necessarily bothering to render it), and more – to embrace it! It's nice! It's an additional communications channel, and that can be very useful. Commented Mar 15, 2021 at 20:26
  • And, as you implicitly point out, we're not allowed to use all of the standard English punctuation already, e.g. underlining! It'd be one thing if they'd deign to dignify us with access to such typographic tools! :) Commented Mar 15, 2021 at 20:29
  • @KennyEvitt You're right, there isn't a particularly solid line between punctuation and "formatting" as I've defined it here. Then again, it may be that "the less punctuation the better" is a reasonable rule of thumb for a title - you probably shouldn't need any semi-colons, parentheses, etc, if you've really captured the essence of your question. As for underlining, its most standard use would be to distinguish between a heading and the text it headed, so adding underlining inside the heading would be some weird kind of recursion.
    – IMSoP
    Commented Mar 15, 2021 at 20:51
  • It's often hard to discuss abstractions without 'communicating past one another'. You raise some points that are possibly good, but I don't think they apply to my question, and I'm skeptical that they're particularly important overall. But then your reputation score makes me think you've spent much more time looking at 'bad' questions, with probably 'bad' titles. Concretely – how do you think my specific question title could be made clearer along the lines you've described, e.g. removing the backticks, punctuation, etc.? Commented Mar 16, 2021 at 15:36
  • 1
    @KennyEvitt As I've said, using backticks for quotes doesn't bother me that much, but the principle of thinking of them as Markdown does, because Markdown implies formatting, even if it's not rendered. However, one thing I notice with that example is that the title (and the question in general) is describing a failed solution, not the required behaviour, so a better title might be something like "Get summary of changed files across several git commits". The detail that you want the output as similar as possible to git log --stat can then be part of the question's detail.
    – IMSoP
    Commented Mar 16, 2021 at 15:48
  • 3
    "why is it necessary to delimit the command at all" - because text is generally easier to read when it's easy to tell what is text and what is code, and it's also sometimes easier to read when the code bits are a bit more grouped together rather trying to put them exactly where comparable English words might go. And if I get an error with a command, I'm probably going to search for that command as is, meaning a bunch of words in the middle will hurt search ranking. Also, if the options only cause a problem when used together, a title lacking some of them is not particularly descriptive.
    – NotThatGuy
    Commented Mar 16, 2021 at 16:37
  • @NotThatGuy I refer you to the first sentence of this answer: "it's not guaranteed to be wrong". There are absolutely cases where quotes, or even parentheses, might be useful in a title; but there are also plenty of cases where pasting the whole command or error message into the title is just laziness, and a clearer title is possible.
    – IMSoP
    Commented Mar 16, 2021 at 16:42
  • It’s a bit hypocritical to declare that question titles should not need punctuation and then come up with an example where the actual code fragment (option) has a clear visual separation (punctuation) on its own, i.e. starts with -- and consists of two - separated words. Now try the same for a scenario where the option is named add and has no option marker on its own…
    – Holger
    Commented Mar 17, 2021 at 11:43
  • @Holger I don't think "hypocrtical" is the right word, but you make an interesting point. I probably would put some kind of quotes in a title like "Problem when using the 'add' option" or "Problem with the 'add' function". However, note that in the last case, "add" is just the name of the function, not the syntax used to call it, so I wouldn't consider it particularly useful or relevant to turn those quote marks into backticks.
    – IMSoP
    Commented Mar 17, 2021 at 16:46
  • Well, sometimes I wonder whether getting a gray background for every occurrence of an identifier in an answer is useful either, however, switching between different kinds of quoting would be even more distracting. So I prefer consistency and that would imply using the same quoting for the title as well.
    – Holger
    Commented Mar 17, 2021 at 16:55
  • @Holger Everything I said above, I would apply to the body of the answer as well: if I'm referring to "the 'add' method" I probably wouldn't bother with backticks, because as you say it's distracting if overused; I'd save them for when I'm writing out the full function call, e.g. "I tried $foo->add($bar) but that gave an error". The only exception is where either Markdown re-purposing punctuation, or the site stripping anything that looks vaguely like HTML, means that the backticks are necessary to escape parsing; and arguably, that should be a different thing from "mark as code" anyway.
    – IMSoP
    Commented Mar 17, 2021 at 17:00
11

Let me begin by saying that I am not against your proposed use of Markdown.
I've been using _underscores_ and *asterisks* in written conversation (email, IRC, etc.), and asterisks in handwriting even, for a couple decades now; I'd find it perfectly normal to use them in titles.
(After all, this is not Markdown's invention, it was already a thing in... WordPerfect 5.1, I think, which came out in the 80s? Anyways...)

However, I can think of one reason not to use backticks in titles, specifically: the fact that backticks in some UNIX shells are part of the command.
In other words, given two questions with the following titles:

  • Problem creating an alias for ls /bin | head -1?
  • Problem creating an alias for `ls /bin | head -1`?

They could reasonably be interpreted as different questions trying to do different things:

  • one is trying to alias the command itself
  • the other one is trying to alias the output of the command

Because of this, people used to dealing with backticks in bash etc. could be misled by other people using them in titles as formatting instead of as an actual part of the question.

1
  • 4
    Meh – "ls /bin | head -1" isn't text for any human language. But that's a good (tho minor) reason to just go ahead and support inline code block formatting in SO/SE titles! Commented Mar 15, 2021 at 14:27
2

As a counterpoint to "you're trying to do too much in the title":

I think this kind of formatting can have its place in titles, when used to

  1. shorten the title, or
  2. disambiguate the title

To use the example given at the bottom of that post:

Instead of "Error running some-command --some-option /var/blah --something --keep-going",

you could use a title like "Error running some-command when I add --keep-going option".

Instead of either, the title could read,

Error running some-command **--some-option** /var/blah

or

Error running some-command --some-option **/var/blah**

In each case drawing my eye to the part causing the problem, without having to write "when I do X".

So, used judiciously, I believe there's a place for these.

2

I used to feel, much like you do, that using backticks for quoting code in question titles was the natural thing to do. At some point, though, my stance on that shifted, as I realised that:

  • The clarity gains of using backticks in titles instead of regular quotes, or even no quotes at all, range, in most cases, from small to nonexistent.

  • When used in titles, backticks look noisier than the alternatives. (While I do like Markdown syntax, it doesn't sit at ease along the large, proportional type face of question titles.)

  • Backticks make the title render inconsistently if I paste it into a comment or post body.

At any rate, though, these aren't particularly deep reasons, and editing a question only for the sake of replacing backticks with regular quotes in its title does seem excessive.

-1

This would work out, but possibly with a limited subset: italics, bold and inline code.

And we need a way to discourage misuse/overuse (In comments, Peter Mortensen suggested a rep limit, like maybe 50?). Also, another answer mentions inline code blocks being interpreted wrongly with for example `ls`. That could be fixed with ``double backticks``

5
  • 3
    The ability to use it could be unlocked for users with a certain number of reputation points (like for inline images). Commented Mar 15, 2021 at 14:23
  • Could work out. Commented Mar 16, 2021 at 5:21
  • 3
    Why should the way the titles are rendered affect the search engine? The search engine would continue to ignore punctuation as basically every search engine does.
    – Holger
    Commented Mar 17, 2021 at 11:50
  • @Holger It ignores punctuation? Commented Mar 18, 2021 at 18:40
  • 1
    Try yourself, stars, double stars, backticks, it doesn’t matter. Even specifying different formatting in the search string doesn’t alter the result.
    – Holger
    Commented Mar 19, 2021 at 7:50
-11

To me, given how much I used Markdown, the backticks are more clearly code than regular quotes.

Markdown is for computers. And you should prefer your question's title to be readily comprehensible by other people; whether it's clear to you really doesn't matter.

The fact is, while many people may be comfortable with markdown typography, it's not intended as a human-readable format, and many more people likely will have an easier time reading the title without it.

Note that it's not even what's "clear" per se. Even for a person who recognizes and understands the markdown, from a linguistic point of view it's often still not going to be as directly comprehensible. That is, our brains more readily recognize and interpret text that is formatted according to human-readable conventions. Humans are highly adaptable of course, so there will be people for whom no more effort is required for markdown, but on average I'd expect those people to be in the minority, even if a significant one.

All that said, I'd prefer to avoid things in the title which tempt you to use markdown in the first place. Again, git log --stat is, I'm sure, perfectly understandable to you, but a title taking the form "Do X with Y modification" isn't nearly as clear as one taking the form "Do Z". The latter is probably going to be more searchable as well. You can certainly elaborate in the post itself, and even use the "X with Y modification" pattern to provide an alternative means of describing your goal. But IMHO that title isn't as clear as it could be, because you've chosen to present your goal as relative to something else instead of stating it directly.

At the end of the day, as long as you're not doing blatantly rule-contrary stuff like putting tags in the title, salutations, "solved", etc. I think you should feel free to author your title as you see fit. But if you want to maximize the visibility of your question, it behooves you to cater to the audience, not to yourself. That means not including typography that some people might mentally stumble on when they try to read the title.

29
  • 9
    I'm not sure I agree completely. The ´ ` " or ' makes perfect sense to me :) It's text surrounded by some type of quotation. When I see the backticks I just instantly recognize it as code-quotation. I assume people who hasn't seen it before just go "Hm.. that's an odd quotation", but still just see it as a quotation.
    – Scratte
    Commented Mar 14, 2021 at 23:55
  • 16
    If you're going to go with "maximizes comprehension of the title", you can go two ways. 1. What most humans will understand, which ironically probably is Mandarin Chinese. 2. What computer literates will understand, which I believe is any of the 4 I mentioned. I'm sure you could even add ❮fancy❯ «quotation» ‹marks› ‟to” ❝that❞.
    – Scratte
    Commented Mar 15, 2021 at 0:48
  • 21
    "while many people may be comfortable with markdown typography, it's not intended as a human-readable format" – this is untrue; John Gruber states explicitly that "The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible." (daringfireball.net/projects/markdown)
    – ash
    Commented Mar 15, 2021 at 0:51
  • 23
    @PeterDuniho: I have to disagree. Gruber's next sentence is "A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions." – clearly his intent was to make unprocessed Markdown documents readable by humans.
    – ash
    Commented Mar 15, 2021 at 1:51
  • 6
    I am not opposed to the conclusion, but like Ash, I disagree with your reasoning. Backticks still look like quotes, and this is a site for programmers, which have higher likelihood to have encountered Markdown sometime in their lives (e.g., documentations, etc.) than general population.
    – justhalf
    Commented Mar 15, 2021 at 5:23
  • 14
    "it's not intended as a human-readable format" That is blatantly wrong. Markdown was explicitly designed to be human-readable without any processing. Its why its so neatly structured and uses markup that very well resembles the elements after processing. Also, backticks are used as quotation marks in regular texts as well (there are various styles of quotation marks), the special meaning for code is a markdown one. So if its about readability for non-md savy users, backticks do the job just as well as any other qutation mark - while md-savy users recognize the special importance.
    – Polygnome
    Commented Mar 15, 2021 at 9:31
  • 2
    While I agree that "not intended as a human-readable format" is the wrong phrasing, I agree with the rest of this answer: there should be no need to use formatting in a title, because it should be a title, not a summary paragraph. Backticks vs quotes ... meh; but if your title is so long you need to emphasise some parts, you should reach for _ or *, you should shorten the title.
    – IMSoP
    Commented Mar 15, 2021 at 10:27
  • 4
    Uggh – one thing I very much dislike is questions that can't be understood at all without reading the body. The title should provide a summary of the question and often times referencing a small code snippet or, e.g. an (exact) CLI option name, is much much clearer and more efficient at communicating the subject of the question. Generally, someone asking a question needs to reference the 'wrong' things – as they don't know (necessarily) the right ones. In my example question, I knew I wanted something like one Git command, but didn't know another command was what I wanted. Commented Mar 15, 2021 at 14:31
  • 1
    @IMSoP It's NOT about formatting. I explicitly included that qualification in my question! You're demonstrating why it's useful to include more, and more precise, info in question titles. But also, how could I even (concisely) rewrite my question to avoid using code/commands? It seems like you're advocating that I just drop the 'code quotes' (backticks), but that seems pointless. If it's okay to include code snippets in titles (and I think it is), it should be fine to quote code as code and backticks are perfectly readable and understandable for that purpose. Commented Mar 15, 2021 at 14:35
  • 1
    @KennyEvitt "one thing I very much dislike is questions that can't be understood at all without reading the body" -> I completely disagree. The thing that should be absolutely avoided is people trying to answer questions without reading the body. Trying to cram the whole question into the title just leads to a mess.
    – IMSoP
    Commented Mar 15, 2021 at 15:48
  • 4
    @10Rep All the users of this site must be familiar with Markdown to participate. But it's actually really easy as almost everyone in the world is familiar with a subset of Markdown – ASCII. But Markdown really is a great text/HTML markup format – it's very readable raw as-is, i.e. as text, i.e. not converted to HTML or otherwise parsed, except by the eyes and brains of human beings (and possibly other intelligent organisms of which we're not currently aware). It's pretty clear that the underscores are emphasis, if only because they do visually emphasize words. Commented Mar 15, 2021 at 20:36
  • 1
    Odd that this answer, which was positively scored when I first came to the thread, is now at -9, considering it's the same position as what the top answer says (at a score of 14).
    – TylerH
    Commented Mar 15, 2021 at 20:51
  • 1
    @KennyEvitt I think most of what we're talking about isn't really worth calling Markdown at all; if you're not parsing it, there's really nothing special about _foo_ compared to /foo/ or >foo<. Once you get to the actual complex bits of Markdown, like links, or embedded images, I mostly understand them, but find them extremely ugly and awkward to use compared to a structured language like HTML.
    – IMSoP
    Commented Mar 15, 2021 at 21:01
  • 1
    @TylerH It's a bad argument. Commented Mar 16, 2021 at 15:43
  • 1
    @10Rep What about you – actually you, right now? Do you have trouble reading raw Markdown? I would bet not! And junior programmers today? In 2021? With Stack Overflow results in the top of programming searches? I can't imagine a world where someone is even capable of learning to program and yet can't read raw Markdown. I dispute that that's even a significant possibility – I would need strong evidence to the contrary to change my mind. I have never encountered anyone that had any difficulty understanding Markdown. This site already does requiring 'knowing' Markdown to participate! Commented Mar 16, 2021 at 15:46

You must log in to answer this question.

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