Share good ideas and conversation.   Login, Join Us, or Take a Tour!
comment by Devac

About C++, isn't that mainly valid to pre-2011 standard? I know that you can still compile and execute outrageous code but with the introduction of pointer ownership (shared, weak, unique) and classes like allocator in Memory headers (or the ones in Boost, ie Smart Pointers) it seems like something that's at least easier to avoid. At least if you can be bothered enough to think about and understand what you are doing instead of crossing your fingers and hoping for the best. ;)

Although the same thing seems to apply to Rust. You can still write insecure code, it's just not available by default. Even then you have to be aware that it's a language where something as simple as integer casting, a problem present since the early days of C, persist within Rust as undefined behaviours despite being a security-oriented replacement.

That said, it does not seem like a good use of your time. At some point, you have to realise that you are basically reinventing or working around the garbage collector for almost no gain. I will still use C++ for a long time, but Rust is a good thing to learn in place of pure C.

lm  ·  787 days ago  ·  link  ·  

Yep, smart pointers and "modern" (post-2011) C/C++ features are very nice, and fix at least the low hanging fruit of what's wrong with those languages. However, you have to use them religiously and your libraries also have to use them to get their benefits. Rust at least forces you and library developers to write safe code by default.

Not to say C++ is necessarily a bad's probably the language I know best, so I feel justified in complaining about it, but I'll admit that it's very good at what it does (especially considering its age) and Rust isn't quite there yet as a full replacement.