6

I've noticed that a new user (who admittedly has lot of rep on other SE sites) has been re-tagging some programming questions to include the tag.

These are the questions so far:

Given that the vast majority of programming on Arduino is in C++, it seems like a somewhat redundant tag in many cases. With that said, I am sure there are cases where it actually is relevant though.

When should we tag with , and when is the programming tag sufficient on its own?

2
  • 2
    I approved an edit to my question as it was very specifically about a difference between C and C++. Feb 28, 2014 at 18:01
  • 1
    @Cybergibbons Likewise, I approved it on my question about c_str and toCharArray, because it relates back to the standard C++ language. I'm not sure about more general cases though. Feb 28, 2014 at 18:04

2 Answers 2

5

I think most questions will be fine with just programming. However, there are some cases where giving it a C++ tag would be appropriate:

  • When its a question on the C/C++ language. The answer will be in the details on cplusplus.com or AVR Libc something.
  • When it's something that the Arduino language differs from standard C++ since you can't do everything.

If it's a question about code not working due to logic errors or not knowing how to write something, that's a programming question.

Only a handful of questions should be tagged C or C++.

4

I usually add the C++ tag when I get the chance for one simple reason:

It activates syntax-colouring for the code.

(assuming there is code posted)

It also activates syntax-colouring for any code in replies.

There is a way of doing that without the C++ tag, which is to paste this in your question or reply:

<!-- language-all: lang-C++ -->

Syntax colouring makes the code much more readable, and is useful to have when browsing someone's code in the question, and someone's code in the answer.

By the way, if you have done this and want to post something which is not code (like serial monitor output) you can also disable the colouring like this:

<!-- language-all: lang-none -->
2
  • 1
    Using a language tag merely for highlighting is a violation of basic SE guidelines - tags should reflect what is a question is about rather than what it contains. If people did not abuse the C++ tag for every question that merely happens to contain some C++ code, the issue of this page would not exist, and the tag could properly be used for language questions. As you point out, there is a correct way to do syntax highlighting - additionally syntax highlighting is hardly essential. Last I checked the arduino IDE did not even support it :-; Oct 16, 2016 at 1:49
  • That was a while ago, right? It would make more sense if SE automatically switched on C++ syntax colouring in code in the Arduino section. Newbies won't know about the tag to turn on colouring (nor care, probably). And what other language would code be in?
    – Nick Gammon Mod
    Oct 16, 2016 at 2:04

You must log in to answer this question.

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