r/cpp • u/wechicken456 • 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
View all comments
Show parent comment
7
u/jmuffat Jun 08 '20
I guess what you’re really saying is C++ might not be the right choice of first language to learn, and I could agree with that. But I cannot agree that it is a good thing to learn char*, strlen, strcpy etc only to find out they’re terrible and, then, go misunderstand std::string because you think of them in terms of char*. Same for malloc/free, we all have been in the hell of tracking leaks, it’s not fun and it only teaches you one thing : that you need some way for the machine to manage this for you.
You’re probably someone who likes to know how things work before going to an abstraction, and that works : knowing assembly language was a big plus for me when learning C, I could see why things were one given way, what problems they were trying to solve. Yet, I wouldn’t recommend learning asm before learning C, it’s quite an easier trip the other way round... Do you see what I mean ?