▲ | IshKebab 5 days ago | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Terrible article. > you can write perfectly fine code without ever needing to worry about the more complex features of the language Not really because of undefined behaviour. You must be aware of and vigilant about the complexities of C++ because the compiler will not tell you when you get it wrong. I would argue that Rust is at least in the same complexity league as C++. But it doesn't matter because you don't need to remember that complexity to write code that works properly (almost all of the time anyway, there are some footguns in async Rust but it's nothing on C++). > Now is [improved safety in Rust rewrites] because of Rust? I’d argue in some small part, yes. However, I think the biggest factor is that any rewrite of an existing codebase is going to yield better results than the original codebase. A factor, sure. The biggest? Doubtful. It isn't only Rust's safety that helps here, it's its excellent type system. > But here’s the thing: all programming languages are unsafe if you don’t know what you’re doing. Somehow managed to fit two fallacies in one sentence! 1. The fallacy of the grey - no language is perfect therefore they are all the same. 2. "I don't make mistakes." > Just using Rust will not magically make your application safe; it will just make it a lot harder to have memory leaks or safety issues. Not true. As I said already Rust's very strong type system helps to make applications less buggy even ignoring memory safety bugs. > Yes, C++ can be made safer; in fact, it can even be made memory safe. There are a number of libraries and tools available that can help make C++ code safer, such as smart pointers, static analysis tools, and memory sanitizers lol > Avoid boost like the plague. Cool, so the ecosystem isn't confusing but you have to avoid one of the most popular libraries. And Boost is fine anyway. It has lots of quite high quality libraries, even if they do love templates too much. > Unless you are writing a large and complex application that requires the specific features provided by Boost, you are better off using other libraries that are more modern and easier to use. Uhuh what would you recommend instead of Boost ICL? I guess it's a valiant attempt but this is basically "in defense of penny farthings" when the safety bicycle was invented. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | MBCook 5 days ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> Just using Rust will not magically make your application safe; it will just make it a lot harder to have memory leaks or safety issues. Even if we take this claim at face value, isn’t that great? Memory safety is a HUGE source of bugs and security issues. So the author is hand-waving away a really really good reason to use Rust (or other memory safe by default language). Overall I agree this seems a lot like “I like C++and I’m good at it so it’s fine” with justifications created from there. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | oytis 5 days ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fallacy of grey, now I know how is it is called. I see it used by C++ programmers to dismiss Rust a lot. Nobody claims that Rust is a perfect language, the argument is that Rust is a better language than C++. |