Background
We've had a lot of meta discussions about the use of c and c++ in the same post. Most recently: How to tag questions about "C with a little C++". This is something of a hot potato that causes friction between new users and veterans. In addition, using both tags often causes irrelevant answers to pop up. In order to avoid this, clearer policies are needed.
I made proposed guidelines as a community wiki in the linked thread, but without much feedback from other users. So before I update the wikis, I would like to get feedback from the C and C++ communities.
Proposal
- We synchronize the tag usage wiki of c and c++ so that they are consistent with each other.
- We should update both tag wikis with specific rules for cross-tagging with both C and C++ tags.
- The part of the C wiki called "Is it C, C++ or both?" will be removed and replaced with the policies below.
- The part of the C++ wiki called "Have a question?" will be removed and replaced with the policies below.
New proposed tag usage policies:
c Tag usage
When posting questions about C programming, please make sure to include:
- Target system and compiler information. This includes the compiler name, version and settings used to compile.
- If your question is specific to one particular version of the the language, add c90 c99 c11 or c17. Pre-standard, historical questions should be tagged kr-c.
- Unless the question explicitly mentions which version of the C standard that is used, it is assumed that the current version is used. That is, whichever version of ISO 9899 that ISO currently lists as active. Please have this in mind when answering or commenting on questions tagged c.
-
c++ Tag usage
When posting questions about C++ programming, please make sure to include:
- Target system and compiler information. This includes the compiler name, version and settings used to compile.
- If your question is specific to one particular version of the the language, add c++98 c++03 c++11 c++14 c++17 or c++20. Questions about boost should add the tag boost.
- Unless the question explicitly mentions which version of the C++ standard that is used, it is assumed that the current version is used. That is, whichever version of ISO 14882 that ISO currently lists as active. Please have this in mind when answering or commenting on questions tagged c++.
Then add this same text to both C and C++ tag wikis:
Using c and c++ together
C and C++ are two distinct and often incompatible languages. Avoid using both tags in the same question unless you have good reasons.A question should be tagged with c only, if:
- It contains pure C, with no trace of C++, or questions with code that could be either language.
- The code is compiled with a C compiler.
A question should be tagged with c++ only, if:
- It contains code with any C++ features. Even though the code may be "C style".
- The code is compiled with a C++ compiler.
A question should be tagged with both c and c++ if it is about:
- Specific differences between C and C++.
- Compatibility or porting code between C and C++.
- C++ code that uses C libraries (for example code using
extern "C"
).
-
Editing and moderation guidelines for posts with both c and c++ tags:
To edit/re-tag/moderate questions with both tags, it is recommended that you have full edit privileges and either a gold c or a gold c++ badge.
If you encounter a post with both tags, edit/re-tag it if needed according to the above rules. If you can tell the language by reading the posted code, simply edit tags accordingly. Avoid prompting the user "is it C or C++?" in comments unless the question is truly unclear.
One example of an unclear question is when the user explicitly claims that they are programming in C, but posts code or compiler messages for C++. If so, prompt for clarification and close-vote as unclear.
"Either C or C++ is fine" opinions from the OP is a strong indication of a poor or unclear question. Answers may be very different depending on language picked. Prompt for clarification, close as unclear/too broad until the OP has clarified this.
Be careful about re-tagging questions once there are answers posted, particularly if there are already both C and C++ answers posted. In such cases, the tags should be left alone, since changing them would make posted answers invalid.
Answers with C++ code to a C question that has never been tagged c++ should be deleted as off-topic. Please check question edit history before flagging/deleting such answers, to verify that the question never had the C++ tag.
Please post feedback & proof-reading below. I'll let this post sit on meta for at least a week before changing tag wikis.
c
tag. I think I understand the motivation. But I see a problem with questions where the answer is the same for both languages and which may be of interest to developers using either one. For example, this popular c question can also be very useful for c++ developers. Removing the c++ tag may make it harder to find for those users.