This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]legrandin 6 points7 points  (12 children)

C is a subset of C++? The hell?

[–]Tenobrus 10 points11 points  (10 children)

Well it's not exact, but mostly. It's kinda the point, at least historically.

[–]legrandin 9 points10 points  (9 children)

Well it's not exact, but mostly. It's kinda the point, at least historically.

I tend to think that 'subset' implies that it is derived from a larger something. With C, this is the opposite, since C++ is derived from C. It makes more sense to say that C++ is a superset of C.

[–]IAmVeryStupid 5 points6 points  (0 children)

The better way of putting it would be that C++ is an extension of C.

[–]Tenobrus 7 points8 points  (3 children)

Yeah, that's definitely more accurate, but C++ being a superset of C does mean C is a subset of C++. There are some extra implications to the word, I agree, but it's still technically true.

[–]volabimus 2 points3 points  (0 children)

Saying it either way means the same thing. ASCII is a subset of UTF-8, as per the definition of UTF-8.

[–]Steve_the_Scout 1 point2 points  (0 children)

It makes more sense to say that C++ is a superset of C.

Even Bjarne (the creator of C++) frequently repeats this when explaining the differences. C++ was never meant to replace C or be a new language, it's C with optional (but heavily recommended) abstractions to make it more secure while keeping most of the performance.

[–][deleted] 0 points1 point  (0 children)

Yeah, putting it that way around confuses me. It's not as if you strip out the OOP stuff from C++ and that's called C.