3 ms·
C++ only needs 4 things: gradually-introducable memory safety, static reflection, first-class compile time string manipulation, and adoption+refinement of its m
by x-shadowban 3y ago
C++ only needs 4 things: gradually-introducable memory safety, static reflection, first-class compile time string manipulation, and adoption+refinement of its modules feature.
- jb1991 3y agoLol “only”
- papichulo2023 3y agoI'd add less verbose ranges. Idk about memory safety, optional and expected are working pretty well for me (i just use it on personal projects though)
- uxp8u61q 3y agoYou can't possibly put syntactic sugar on the same level as memory safety.
- zerr 3y agoI'd also vote for std::string split and join functions. And networking.
- LeSaucy 3y agoQt?
- harrid 3y agoC++ is a memory safe language if not abused.
- uxp8u61q 3y agoJust don't write bugs!
- harrid 3y agoIt's impossible to memory leak even with bugs if you don't use antique parts of the language that won't pass any static analysis anyways.
- uxp8u61q 3y agoWhat antique part of the language am I using in this bugged code? class A {}; std::unique_ptr<A> array(new A[256]); It's very easy to produce innocuous-looking code that contains leaks. (And yes, I know that make_unique solves the problem here.)
- frankjr 3y agoConsidering that Chromium, being one of the most heavily statically analyzed code bases, is full of commits which fix memory leaks, your comment makes absolutely no sense. https://github.com/search?q=repo%3Achromium%2Fchromium+memory+leak&type=commits https://github.com/search?q=repo%3Achromium%2Fchromium+memor...
- deschutes 3y agoChromium is a massive project spanning decades of intense active development that intricately connects just about every domain of programming. A few leaks fixed per month is nothing. Further there is no major language promising no leaks once you include things like retained references to garbage and reference cycles. Leaks are one thing modern C++ solves pretty well.
- otabdeveloper4 3y ago
- pjmlp 3y agoThat is the idea of C++ profiles, based on Ada's language profiles, being pushed by Bjarne Stroustoup. Now, how willing WG21 and the compiler vendors are open to the idea, is anyone's guess.
- dazzlefruit 3y agoWhat’s the use case for static reflection?