What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

There is no syntax highlighting nor any ways to emphasize code written in comments.

I have noticed that this is one of the key factors leading users to misunderstand one another.

I use the backticks (`) and % signs at the moment for code that I write in comments.

Please, give us an option to turn syntax highlighting on for comments. We cannot avoid the fact that that some users decide to put code in their comments.

share|improve this question
    
Comments are meant for shortish (note the 600 character limit) remarks on the question or answer. If you have code then add it to your question or answer - or post a new answer. –  ChrisF Jul 1 '09 at 9:44
1  
we might make bold and italic work, but that's about it. –  Jeff Atwood Jul 3 '09 at 2:17
2  
@Jeff Atwood: Don't forget backticks along with bold and italic. –  LeakyCode Jul 3 '09 at 3:17
1  
@Jeff: Thank you! Comments look now awesome :) –  Masi Jul 4 '09 at 10:01
1  
@Masi: Ironically, the new implementation just broke one of your comments: stackoverflow.com/questions/679108/… –  David Citron Jul 14 '09 at 14:17

4 Answers 4

up vote 4 down vote accepted

At least, I would want bold and italic to work.

As for syntax highlighting, you don't get that for simple inlined code sections, so why would you need it in comments.

share|improve this answer
    
If you mean that we should have inclined code sections in comments, then I support your idea. –  Masi Jun 30 '09 at 18:29
    
Again inclined code in comments defeats the purpose of what a comment is for. There's a reason its character limited as well. –  Ian Elliott Jun 30 '09 at 18:35
    
I actually think I would like the inlined code sections to work, as a highlighting feature. –  Brad Gilbert Jun 30 '09 at 20:08
    
@Brad Gilbert: I agree with you! That would be great. –  Masi Jul 1 '09 at 14:34
4  
Hey look at This, Code examples work too. –  Brad Gilbert Jul 3 '09 at 13:45

I suggest that atleast add support for a New Line. Presently, everything gets posted in one line. Its quite ugly.

share|improve this answer

This is why you are supposed to edit your question or answer. Comments were just not meant for extended discussion.

Keep the comments short and simple please.

share|improve this answer
1  
@Rich: I agree with you that comments should be short and simple. However, we cannot avoid that people put codes to comments. --- Therefore, I would like to have the code highlighting for comments optionally such that you can put it on if you have enough rep. –  Masi Jun 30 '09 at 14:57
    
@Masi: We can avoid that by not encouraging the behavior. Code in comments is not acceptable (at least not enough where you would need highlighting), so why would we encourage this? Comments are less functional by design. –  GEOCHET Jun 30 '09 at 15:02
    
@Rich B: While I don't want full syntax highlighting in the comments, I wouldn't mind the ability to put stuff in backticks like in an answer. –  Hilarious Comedy Pesto Jun 30 '09 at 20:30

Comments aren't the proper place for full blown code. For one, it isn't even multi-line. Secondly there's no other way to format a comment.

If you have the need to post enough code that it requires syntax highlighting, then post it as an answer, or have the person requiring it ask another question where you can provide an answer there.

share|improve this answer
    
Or ask a question yourself and provide the answer to it. –  Nathan Fellman Jun 30 '09 at 17:47

You must log in to answer this question.