3 ms·
C and C++ distinguish between the language and its implementations (compiler plus runtime). Producing good error messages is the compiler's job, not the languag
by layer8 3y ago
C and C++ distinguish between the language and its implementations (compiler plus runtime). Producing good error messages is the compiler's job, not the language's.
- ReactiveJelly 3y agoCool, what apt command installs the C++ spec and not g++?
- bluGill 3y agoClang would be my recommendation. Though once clang showed better error messages were possible g++ cleaned up and things a much better than 15 years ago.
- codethief 3y agoDepending on how the language works and what it allows you to do, your compiler's error messages can only be so helpful, though. I mean, imagine replacing "C and C++" in your message with "Brainfuck". Error messages would be guaranteed to be very low-level, so won't help you solve the actual higher-level problems.
- layer8 3y agoYes, but in the cited example of basic_string, providing useful error messages isn’t actually that hard. It would be more interesting to hear an argument about what specific C++ features make providing useful error messages hard (if indeed they do) for which precise reasons, that would warrant the accusation that the language designers (rather than he compiler writers) didn’t pay attention to usability.
- AlbertCory 3y agoIndeed. And the current generation of error messages is much improved, so clearly it was possible to do better.