3 ms·
We will see how this plays out. I'm not sure what options C has though, while remaining backward compatible. They removed gets (which cannot be used safely) i
by bluGill 2y ago
We will see how this plays out. I'm not sure what options C has though, while remaining backward compatible. They removed gets (which cannot be used safely) in C11, but most things people don't like in C it is really hard to figure out how to make an alternative while still being C (that is compatible and looks like existing C)
C++ is actively working on profiles, and if you enable the right profile many of the easy ways to be insecure are not longer possible. Or at least that is the goal only time will tell if they make it in, and then more time if they are both used and make a difference. However C++ developers have long said "No naked new/delete", data structures where the invariant (length...) is enforced - thus a profile can remove new/delete and the places where we now know the data structure invariant isn't enforced while still being a usable language.
Because of the above anyone who is in C++ objects to phrases like "C and C++ or C/C++" - C++ is trying to leave C behind expect where compatibility with C is required.
- tialaramex 2y ago> C++ is trying to leave C behind expect where compatibility with C is required. What was it Dua Lipa sings? "If you're under him, you ain't getting over him". C is foundational to C++. Look at your miserable type system. Do you think anybody who designs type systems built that? No. This is the C type system, it's defective but it was easy to implement. Actually fixing C++ needs a ground-up rebuild, that's what you see (impressively) in Sean Baxter's work for example. I doubt it will make a real difference, but to his credit Sean looked at all the horrible problems and rolled up his sleeves and fixed them with a fairly radical set of required language and library changes, rather than kicking them under a rug and insisting it's all fine, just don't look under the rug.
- uecker 2y agoC can essentially do the same thing. I do not see why C++ would have a fundamental advantage here.