▲ | carlmr 8 hours ago | |
>the one easier to use is going to get wider spread / adoption Between Rust and C++, this is Rust. In C++ you need to a lot more memory safety verification in your head, there are thousands of footguns that you need to be aware of at all times, the template metaprogramming facilities are really hard to grok with their weird syntax. Rust is strict, but for the kinds of applications that you would replace C++ in this makes it a lot easier to learn. I think the sentiment that Rust is hard comes from people that come from managed languages (Python/Java/C#) that aren't used to manual memory management. From that perspective Rust is indeed hard. | ||
▲ | grayhatter an hour ago | parent | next [-] | |
I'm used to writing C, and think pointers are easy to understand. I wouldn't call rust 'hard' to learn, but it is without a doubt painful. You also aren't doing manual memory management in rust either... I'd assume the sentiment comes from the irrelevant hoops rust makes you jump through to just compile something simple. You don't need to be aware of 1000s of foot guns for every block of non rust code. But you do have to remember dozens of pedantic rules, or stdlib wrappers just to trick rust into allowing you to compile your simple/demo code. | ||
▲ | chucke1992 2 hours ago | parent | prev [-] | |
C++ has much more bigger inertia. It is like the "default" for all the areas where it is being used. So when learning a language people would rather go to C++ first and then to Rust, if they are really planning to work in corresponding area (game dev etc.). Or even go to C. Rust will probably replace C++ in some areas where it is a legacy app (or part of the app) that is not changed frequently anymore. |