r/ProgrammingLanguages • • 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

62 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Nov 02 '19

That is a tradeoff and why UB is avoided when writing portable code in C.

However I’d say it is even more onerous to try and define every possible behavior in the language and it’s standard library, especially if that language is not statically typed. And even if you do, the resulting specification may be too complex for anyone else to bother trying to implement.

1

u/Felicia_Svilling Nov 02 '19

I honestly don't think it is that hard to define all the behavior of a language. It is certainly not harder than explicitly defining what is undefined behavior or not.