14

It would be nice if backticked code in question titles were rendered the same way they are in question bodies. Since there are so many questions with code in them I feel it would be a big plus. Example.

This would look a lot nicer in listings and on the page itself if the code strings were rendered as such.

Similar ideas discussed here.

5
  • I wondered whether it's disadvantageous, e.g. for SEO reasons or any other, to have inline elements within the heading; but no, I see that phrasing content (for example, <code>) is explicitly permitted.
    – ChrisW
    Commented Jan 26, 2011 at 2:08
  • 3
    possible duplicate of Fix Markdown/SmartyPants in question titles
    – Yi Jiang
    Commented Jan 26, 2011 at 2:08
  • it wouldn't be transformed at all in the <title>, only in the h1 and question listings Commented Jan 26, 2011 at 3:21
  • 1
    the question Yi Jiang linked has nothing to do with HTML title tags. The first suggestion there is, in fact, an exact duplicate of what you're asking for.
    – Pops
    Commented Jan 31, 2011 at 13:18
  • Hm, you're right. Not sure what I was thinking the first time I looked at it. Commented Jan 31, 2011 at 20:36

1 Answer 1

5

It may just be me, but in my opinion, good (great?) question titles shouldn't contain code snippets. Your question title here, for example, fits my definition of a relatively good title: concise, the question actually matches the title, good keywords for searching... Code snippets would have too many of the common language keywords, in this case: {raise, new, Exception} (not to mention the ubiquitous foo) for good search results. I'm not sure that having code snippets in titles is something to encourage.

3
  • 3
    In all fairness, I'm not sure what I would retitle your linked post as, though :)P
    – robert_x44
    Commented Jan 26, 2011 at 2:18
  • 3
    There are lots of great questions that are about a particular keyword or snippet of code. You're saying we should discourage saying what the question is about in the title? Commented Aug 17, 2012 at 5:01
  • You wrote "code snippets". How about programming language keywords, final, volatile, Object or common C++ template parameters, e.g., Compare, begin, end?
    – kevinarpe
    Commented Jul 30, 2020 at 17:40

You must log in to answer this question.

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