3 ms·
I probably shouldn't get in on this heated discussion ... but C++ aims to be a safer (higher level) C, at no runtime cost. I think it mostly succeeds at this.
by petke 11y ago
I probably shouldn't get in on this heated discussion ... but C++ aims to be a safer (higher level) C, at no runtime cost. I think it mostly succeeds at this.
I think C++ can only get so far, without deprecating some of C. Or at least C style code, should come with a big warning from the compiler:
"You are using an unsafe language feature. Are you absolutely sure there is no bug here, and there are no way to use safe language features instead?"
In libraries there might be cases where C-style code like manual pointer arithmetic, c arrays, manual memory management, c-style casts, or *void pointers, uninitialized variables, etc are necessary. But in user code most often there are safer replacements.
- pcwalton 11y ago> but C++ aims to be a safer (higher level) C, at no runtime cost. I think it mostly succeeds at this. No, it doesn't succeed at this at all. Large C++ codebases routinely suffer from the same problems that C does. For proof, search the CVE lists for browser vulnerabilities.