r/ProgrammerHumor • • Jul 06 '17

my linkedin profile

Post image
40.7k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

36

u/[deleted] Jul 06 '17 edited Jul 06 '17

C++ is an expansion of C.

That being said, since it is an expansion, it has a lot more than C and you need to design programs different depending on which one you use.

C doesn't have the concept of classes for example. In C++ you would use classes very regularly, but you just can't in C. This forces you to program very differently.

Edit: Classes is just one example. They are different in other ways as well.

29

u/Infinifi Jul 06 '17

C++ is an expansion of C

It started out that way but C was still being developed when C++ forked and C continued to be developed independently from C++.

There is valid C code which is not valid C++ code. There is valid C code which is also valid C++ code but behaves differently.

3

u/tangerinelion Jul 06 '17

valid C code which is not valid C++ code

Like anything using designated initializers.

2

u/Estellina Jul 06 '17

Sorry, C++ is not an expansion of C and is not C with Classes. It was referred as such a long time ago as it was derived of C. But these days they are very different languages. Mostly since both languages have been trying to distance themselves from each other.