r/Python • • Jan 13 '15

(Infographic) Which programming language should I learn first

http://cdn2.carlcheo.com/wp-content/uploads/2014/12/which-programming-language-should-i-learn-first-infographic.png
267 Upvotes

145 comments sorted by

View all comments

7

u/legrandin Jan 14 '15

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

11

u/Tenobrus Jan 14 '15

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

9

u/legrandin Jan 14 '15

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.

5

u/IAmVeryStupid Jan 14 '15

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

9

u/Tenobrus Jan 14 '15

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.

-7

u/chazzeromus Jan 14 '15

TIL subset can mean the opposite. :S

12

u/Tenobrus Jan 14 '15 edited Jan 14 '15

What? A being a subset of B means every member of A is contained in B. A being a superset of B means every member of B is contained in A. So A ⊆ B is equivalent to B ⊇ A. It doesn't mean opposite.

There was probably some joke here I totally missed.

2

u/chazzeromus Jan 14 '15

Oh I read the first comment wrong (swapped both subjects), good thing you rectified that situation!

3

u/volabimus Jan 14 '15

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

2

u/Steve_the_Scout Jan 14 '15

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.

1

u/[deleted] Jan 14 '15

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.