3 ms·
Rust is a complicated language, but I don’t it reaches C++ levels of complexity. One of the pernicious aspects of “mastering” C++ is understanding all of its le
by woodruffw 5y ago
Rust is a complicated language, but I don’t it reaches C++ levels of complexity. One of the pernicious aspects of “mastering” C++ is understanding all of its leaky abstractions; there’s nothing like SIOF or SFINAE in Rust.
- IshKebab 5y agoIt definitely does. I think a lot of people think it doesn't because a) most people who know both have far more experience with C++ and are yet to experience its really complicated bits yet, and b) C++ has an actual specification so you can read about all its complexity. Rust may not have SFINAE but C++ doesn't have for<'a>, Phantom data or Pin.
- woodruffw 5y ago> Rust may not have SFINAE but C++ doesn't have for<'a>, Phantom data or Pin. I'll grant you PhantomData, but I'd argue with the other two. C++ does have lifetimes and pinning semantics, they're just implicit and (largely) taken for granted. That is, until you cause memory unsafety with either. IMO, the overall pattern between C++ and Rust is that "advanced" use requires many of the same skills between the two, but that (1) Rust is much better about avoiding "advanced" use, and (2) Rust forces the user to be much more explicit about what they actually mean (cf. lifetimes and pinning). These are arguably more complex than what C++ does, but only in the sense that C++ amortizes that complexity in blood.
- afdbcreid 5y ago> C++ does have lifetimes and pinning semantics, they're just implicit and (largely) taken for granted. C++ does have pinning, but it is much rarer than in Rust because of user-defined move constructors.