Recently, I have been active a lot on the Ethereum site. It got a recent design overhaul which shows that some progression is happening. Unfortunately, one of the main issues is that the Solidity code doesn't have any syntax highlighting which makes it incredible hard to read.

A workaround is to use the language highlighting of Delphi or PHP, since the syntax highlighting is at least a little bit similar. However, this leads to inconsistent syntax highlighting and wrong code snippet classification.

Since Solidity has become a popular language over the years, now should be the perfect time to support it.

  • 3
    Solidity is supported by HighlightJS: github.com/highlightjs/highlightjs-solidity which is a pre-requisite to get that highlighting enabled in the first place.
    – rene
    Sep 23, 2022 at 10:39
  • 2
    For reference, see this recent staff answer about syntax highlight support for several languages.
    – bad_coder
    Sep 23, 2022 at 11:17
  • Related: What is syntax highlighting and how does it work?. Solidity isn't listed there. Sep 24, 2022 at 9:13
  • Re "incredible hard to read": Code should be readable without syntax highlighting (it is something extra; in the nice-to-have category), e.g. with proper use of space, incl. (consistent) indentation (one reason for code standards to exist). Is Solidity special in that regard? Samples from the site in question. It looks like any other curly-bracket language. Sep 24, 2022 at 9:26
  • Solidity is mainly used for dealing with users funds and once deployed, the code is immutable. Any mistake could lead to a loss in funds and is not easily fixable. So yes I would say solidity is special in that regard. Additionally, how does a curly-bracket language make the syntax "easier to read"? This would just affect the formatting, and this is thankfully already done by most of the users in this forum. Syntax highlighting helps to understand the code faster and prevents errors. So I don't get the comment It looks like any other curly-bracket language.
    – Throvn
    Oct 14, 2022 at 6:32


You must log in to answer this question.

Browse other questions tagged .