3 ms·
> Rust is a formalization/codification of idiomatic C++ Idiomatic C++ favors values and copy semantics. Rust favors references and move semantics. C++ has fu
by civility 10y ago
> Rust is a formalization/codification of idiomatic C++
Idiomatic C++ favors values and copy semantics. Rust favors references and move semantics. C++ has function and method overloading, and Rust does not. There are so many places where Rust chose exactly the opposite of "modern" C++ that calling Rust a codification or formalization of C++ makes no sense at all to me. Rust has some great features, and C++ has a lot of warts, but Rust is definitely not an improved C++.
Rust seems like a reaction to problems in C++, but for many design decisions I think they erred on the side of doing the opposite of C++ and ignored the things C++ does well.
- moosingin3space 10y ago> ignored the things C++ does well What are you looking for that Rust is missing?
- civility 10y agoI wouldn't use the word "missing". I believe several of the Rust language designers are very familiar with C++, and to say that something is missing implies it was an oversight or an accident, or maybe they'll get to it later. Instead, I believe they don't value some of the powerful features in C++ and ignored the fact that other people find those features very valuable. Here's an example that has bitten me several times now. Try and implement the following C++14 code in Rust: template<class T> struct Something { T a, b; }; template<class S, class T> auto operator *(const S& x, const Something<T>& y) { return Something<decltype(S() * T())> { x*y.a, x*y.b }; } There are ugly workarounds, and I'm certain they have their reasons, but it's so much simpler and cleaner in C++.