3 ms·
> told the computer it was safe > by not deleting I think there's a problem here.
by Dylan16807 5y ago
> told the computer it was safe
> by not deleting
I think there's a problem here.
- junon 5y agoProbably one of the only common language-lawyer pieces of criticism of C++ I fully agree with. I'm a pretty firm believer that a language should be as constrained as possible with the ability to make it explicitly less-constrained. C++ fails at this pretty spectacularly.
- initplus 5y agoRule of three is such a common C++ concept though, I would be surprised if anyone with more than a few weeks experience with the language is still running into such issues.
- overgard 5y agoI've been coding C++ off and on since 1998. But not all the code I use is written by me... not even most of it. I'd love it if everyone followed best practices... but they don't.
- rualca 5y ago> I think there's a problem here. There is a problem indeed, which is OP's failure to implement exception-safe code. If someone opts to use exceptions, they have the responsibility of writing their code in a way that complies with scenarios involving throwing exceptions. Failing to support a scenario by not following the most basic principles is something that's on the person writing the code, not the language. It would make as much sense to blame java for the problems you create by not initializing objects in some code paths, because your code started to throw null pointer exceptions.
- Dylan16807 5y agoAre you talking about the same thing as everyone else? auto fooRef = myWidget.getRef(); vs. auto& fooRef = myWidget.getRef();? That's not a problem caused by exceptions. If you're talking about the article, the standards committee seems to think it's a confusing interpretation that never should have existed, and it's pretty ridiculous to say it's "basic principles".