1

Hi, excuse me if this already exists, but could we have a means of syntax-highlighting code that is tailored to the forum that it's posted on, and optionally an author-specified language. I.e. on the C forum, the highlighing would be heavily tailored to highlight C code. You get the idea I'm sure.
I've noticed very marginal highlighting over on the Assembly forum which makes code harder to read - especially since certain languages (cough assembly cough) can sometimes be messy in themselves without the syntax highlighting messing things up further.

Cheers

Edited by Assembly Guy

5
Contributors
10
Replies
58
Views
4 Years
Discussion Span
Last Post by Dani
Featured Replies
  • I'm kind of in agreement with the OP here. Assembly code is hard to read at the best of times and the way it's highlighted by Prettify only makes it worse. The way the highlighting catches your attention can artificially subset pieces of code and you have to be aware … Read More

  • 1
    Dani 1,665   4 Years Ago

    Sorry, missed pritaeas's post :( So should I just remove all syntax highlighting from asm?? Read More

  • 1

    > should I just remove all syntax highlighting from asm?? That's a good idea. I vote yes. Read More

0

If code is hard to read it ie either because of

  1. the language
  2. the programmer

Some languages (APL, Perl) make it very easy to write unreadable code. Other languages make it slightly less easy but a programmer who lacks a decent style will write difficult-to-read code regardless of whatever syntax highlighting is available. I expect that providing a parser for all the languages for which separate forums exist would not be worth the effort. Well written code needs no highlighting to make it readable. Poorly written code would not be improved by it.

0

could we have a means of syntax-highlighting code that is tailored to the forum that it's posted on

This currently exists and is in place.

optionally an author-specified languag

There are no current plans for this, sorry. We tried playing around with it last year but found the Markdown syntax support to be buggy at best.

I've noticed very marginal highlighting over on the Assembly forum which makes code harder to rea

We currently use Prettify to handle our syntax highlighting. Unfortunately, Assembly is not one of its supported languages.

0

We currently use Prettify

I take it there's no way to add a new language syntax with Prettify?

0

There is. A recent discussion on SO meta shows that there is no such package yet, and that it's problematic to make because of all the different constructs for different processors. They state correctly that just highlighting the opcode is not really useful.

1

I'm kind of in agreement with the OP here.

Assembly code is hard to read at the best of times and the way it's highlighted by Prettify only makes it worse.
The way the highlighting catches your attention can artificially subset pieces of code and you have to be aware of needing to undo something your brain tends to do automatically. This is especially bad if you've been working recently in more common syntax languages ;)

My personal opinion is of removing all syntax highlighting from Assembly. (Essentially an extension that does nothing)

0

I'm open to doing that, but my first choice would be for someone way smarter than I to create an Assembly definition for Prettify.

1

Sorry, missed pritaeas's post :(

So should I just remove all syntax highlighting from asm??

0

Syntax highlighting has been removed from the assembly forum moving forward.

Removing it retroactively would involve repopulating the cache and doing so is very costly, so I want to avoid doing that until I need to do it for another reason at the same time.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.