Hacker News new | past | comments | ask | show | jobs | submit login

I don't think thats correct.. C++ has UB because of backwards compatibility, which has origins to design choices of C in the 70s. Its not like it is optimized for performance above all else, it had immediate needs to be close to metal, and that is the best they could do back then, there was not some "strongly typed" versus "performance" debate happening at the time.

The creator of C++ would love for there to be safer abstractions, but has the baggage of the past to carry.




Modern C++ is still a safety-third design.

std::optional is relatively new, and supports dereferencing, which when it’s empty is UB instead of an abort.

There are no plans to add checks to any existing APIs, because “it didn’t have a branch before” is also considered a compatibility issue.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: