Quantcast
Viewing all articles
Browse latest Browse all 12

Answer by user44761 for Should I stop using the term C/C++?

There has to be a reason why these terms come together so often. While you should not tell your C teacher that his language is a subset of C++, there is some truth here. Others already have exposed your teacher's point of view. This is very nice (and illustrated with examples, etc.). But we don't live in an ivory tower, or a book.

Your big boss could not care less about the exact language you used. If he knows a bit about programming, just tell him you used C/C++ and it will sound like "I used a language that needs to be compiled to machine code, with DLLs and all the complicated stuff". This is the "external communication" part.

If you create a library that can be interfaced by both C and C++, you definitely want to call it a C/C++ library. Of course, someone will raise a hand and ask why you don't call this a C library that happens to have a C++ wrapper, and anyway C++ can link to C libraries so you don't need to mention it at all. Just answer: "Yes, you are right, this is a C/C++ library". This is the "internal communication" part.

If you create a lexical analyzer for C++, you'd be surprised how well it works with C. You might even not need to modify it all. This is the "if it looks like a duck, etc." part.

Etc.

The majority of C programs I have ever seen compile (and work) without modification as C++ code. Don't let a few exceptions or dogmatic (however influential) programmers fool your intuition. C and C++ are so close, and so often compatible, and so often mixed and matched together, that the term C/C++ is used. It is used because it is useful to describe these kinds of situations where it does not really matter whether you are considering C or C++, as long as it's not Java or PHP. We know it's "wrong", but we don't care, it's more useful than wrong.

It may be abused, it may be stupid, but still, I'm not sure what benefit you will get by being more pedantic than needed and refuse to communicate in terms that others understand. If you feel uneasy in some specific situation, then simply don't use the generic term C/C++, but the one relevant to the case (either C or C++).

Don't be afraid of the future. Our operating systems are written in C. Quite a lot of the C/C++ current software production happens in C++. This couple is here to stay for quite a while. Nobody has interest in one being made more incompatible with the other (quite the other way around, actually).

To be specific about your points:

1) It depends. Yes when it could lead to a confusion, when you feel uneasy, or when it's simply wrong or out of context. No when you think it's adequate.

2) N/A

3) I think no, but I have no crystal ball.

4) no idea

5) I don't think so as nothing pushes in this direction


Viewing all articles
Browse latest Browse all 12

Trending Articles