1
$\begingroup$

Take this code sample from meta.SE:

<!-- language: lang-js -->

    var a = 3;
    while( !(a < 0)){
        alert("JavaScript code <b>goes</b> here.");
        a--;
    }

I've written it below (the first line is recognized, processed and eaten by the SE syntax parser):

var a = 3;
while( !(a < 0)){
    alert("JavaScript code <b>goes</b> here.");
    a--;
}

I see no syntax highlighting (i.e. colours) where I should. Having written one or two posts on physics.SE where I did use code, highlighting would've been much appreciated. Is this a bug and could it perhaps be amended?

$\endgroup$
2
  • 3
    $\begingroup$ I'm pretty sure this is not a bug, so I'm changing this to feature-request. See meta.stackexchange.com/q/224236 for the reason they don't default to supporting syntax highlighting on all sites. $\endgroup$ – user10851 Dec 2 '14 at 23:51
  • $\begingroup$ @ChrisWhite I see, I suppose that does answer the question then. I don't imagine that it would be much of a performance issue, though: The page loads on physics.SE are low as is. But granted, the need for this feature does not arise very often, and it probably would not be worth the trouble. $\endgroup$ – alarge Dec 2 '14 at 23:54
8
$\begingroup$

This is a site for questions about physics concepts, not about code. The community has decided that "physics concepts" extends to high-level descriptions of algorithms or procedures for physics-related computation, but not to implementation details. In practice, this usually means that most questions shouldn't have code samples in them, and the few that do should be written so that they would still make sense if the code were omitted. In light of that I don't think the benefit of syntax highlighting is worth the cost.

$\endgroup$

You must log in to answer this question.

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