10

We've had quite a few questions involving code on the site now:

The general consensus (see also here) is that programming questions are usually on-topic provided there is a link to an IoT use case.

I think it'd be helpful to enable syntax highlighting here (using language hints, where <!-- language: lang-example --> comments are placed before the code block). Personally, I find it much easier to read code blocks with syntax highlighting once they begin to pass trivial sizes (even 5 or 6 lines can benefit from some syntax highlighting), so I imagine many posts will benefit here.

Would this be useful to others, and should it be enabled here? If there's enough support, I'll let the community managers know that we're interested, but I see little point in enabling it if the majority of people aren't going to use it.

4 Answers 4

7

This is enabled now (and here on meta). It won't happen by default; you'll have to use the hints to trigger it, unless a moderator sets a default for a specific tag.

0
6

I like the idea. We don't have a ton of coding questions yet (not as many as I would like to see personally), but the fact remains that you can't have the IoT without coding. While some questions obviously have nothing to do with coding, as you said, coding questions as relate to the Internet of Things are on topic. In my view, enabling syntax highlighting would make the following improvements:

  1. Improve user experience for existing members, making them feel like coding questions are welcome (which they are!)
  2. Improve user experience for first time viewers, making them feel like code isn't just a secondary thought dump-in; that coding is part of what we do as IoT people.

I definitely support this feature request.

5

Since syntax-highlighting can also be made based on tags and moderators can set these relations between a tag and a syntax-highlighting the use of these comments is not even mandatory.

Of course, that only works if there is a reasonably fixed relation between tag and language.

Anyways I agree that we should activate it in our little SE corner.

1
  • Yeah, I wasn't too sure of any 'no brainer' tags that could be syntax highlighted. For some of the example questions, there are no tags that could possibly be used to infer the language (e.g. this one) but I think we will need to consider some tags which might be highlightable.
    – Aurora0001
    Apr 20, 2017 at 18:23
3

I have edited our posts so far to enable the fitting code syntax highlighting. It seems like we don't have a real conclusive tag which we could set to a definitive language. If there is a more clear correlation in the future just shoot a notice to the mod team and we will set the proper default for the tag.

You must log in to answer this question.

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