Possible Duplicate:
Allow highlighting certain bits of a code fragment or quote

Sometimes I need to paste a large lump of code, as in context it is all relevant, but I would like people to perhaps start reading the code from a specific point, or to bring their attention to a specific part of the code first instead of them having to trawl linearlly through initially irrelevant stuff.

It would be good to have code highlighting I think.

For example:

alt text


1 Answer 1


My gut feeling is that if you need such a feature, then you already pasted too much code.

  • Explain the problem in specific terms - what is failing and how.
  • Paste only the code that is necessary (the one you would like to highlight).
  • If necessary - or if people ask you for it, add a few lines of code that detail how the previous relevant code is initialized, how it is used, etc.

EDIT: If you feel that you have a question for which those guidelines fail, then feel free to post a link to it. I'd rather teach you how to phrase better questions.


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