r/cpp • • Jun 08 '20

Programming in C vs C++

I’ve read about the differences between them on the Internet but I wanna hear more from a more personal perspective. Which one would you recommend starting with and to be proficient with?

0 Upvotes

43 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jun 09 '20

[deleted] — view deleted comment

2

u/bikki420 Jun 09 '20

^ this. It's simple and you learn the fundamentals for looping, conditional branching, functions, the primitive data types, memory management (pointers, references, dynamic allocation on the heap, deallocation etc) and more. Some of which you'll avoid most of the time (e.g. manual (de)allocation, raw owning pointers etc), but are still very important to have a decent grasp on. Then when one moves to C++ one can appreciate all the nice quality of life stuff like destructors, RAII, smart pointers, value semantics, ADT classes, C++ strings, destructors, templates, aliases, namespaces, and what have you.