Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Over the current year, I have written more code in VB.NET than C#. Hence, my code samples were obviously Visual Basic.

I have noticed some bad syntax highlight with this language, particularly when inserting comments in code sample, (otherwise the highlight is great), which seems to be parsed as a string of text by the code sample parser or syntax highlighter of SO, call it what you want, I don't actually know the exact technical term for this.

While I understand that SO cannot offer syntax highlight for every single existing programming languages, I am wondering whether this would be doable to provide some sort of syntax highlighter such as ones provided in Notepad++, for example.

What I mean is that one could choose, while editing his/her question/answer, the language highlighting that suits best for the code sample he/she provides. Indeed, C# would be the default.

That said, would syntax highlighting compatible with other languages than C# be worthy?

share|improve this question
Lol, other languages than C#, errr...? – Arjan Dec 6 '10 at 14:54
up vote 2 down vote accepted

The syntax highlighting does not parse the code blocks as anything in particular. Instead, it uses a set of heuristics that are reasonable correct in a pretty big set of more-or-less common languages. In fact, most of the heuristics are for c-like languages, which is why c# comes out pretty well.

In any case, c# is not being given special treatment and visual basic is not being ignored---it simple is wonky enough that general purpose heuristics don't work well with it.

share|improve this answer

It gets wonky on VB.NET comments. Fix that and it will look okay. Like this:

Sub Test()
'' double quotes are okayish
End Sub
share|improve this answer

You must log in to answer this question.

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