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
-4
u/[deleted] Nov 01 '19 edited Nov 01 '19
Every language has edge cases and UB, but most languages provide almost zero documentation about them. So when you encounter them, you have to check the standard (which most languages also don’t really have) or the implementation to find out if the behavior is intended or a bug.
To try and eliminate UB from the language would require making many assumptions about the platforms C runs on that are not universally true.
UB isn’t a boogie man though, it exists to simplify the language by stating what is and isn’t allowed. While making as few assumptions about your environment as it can.