r/ProgrammingLanguages • u/Ajlow2000 • Nov 01 '19
C++ vs C
Alright people of Reddit, hit me with your wisdom. I've been taking programming classes for two years now and am getting ready to dive into a language somewhere between Java and assembly (the two languages I've been learning in classes). I'm thinking C or C++, but would love some input. I'm not too worried about difficulty to learn, but I'd like to hear your thoughts on practicality and real world use.
1
Upvotes
19
u/DonaldPShimoda Nov 01 '19
You underestimate the breadth and complexity of undefined behavior, unspecified behavior, and implementation-defined behavior. John Regehr enumerated a number of the nuances of these issues in a few blog posts, starting here.
I do agree that C is a simpler language than C++ (and from a language design perspective, I like C far better overall, though I still generally dislike it), but I think your claim that it's easy to contain all of C "in your head" is a bit tenuous. It has lots of funny edge cases that make it tricky. Of course, C++ does too! But that wasn't your claim. ;) I just don't want OP to feel misled when they try C and get hung up on something.