Hacker News new | past | comments | ask | show | jobs | submit login

On the other-hand, I find it annoying in Rust that an assignment or an unadorned function parameter might result in a move or a copy and you can't tell by the function signature or call site. Instead it depends on whether the type implements the Copy trait, which is a big semantic difference based on "spooky action at a distance".

> You also have to be careful not to mess with a moved-from object, as it's in an unspecified state.

This is a great example of Rust being easier, even when it just as complex. Both languages don't allow you to use an object after it is moved, so it is the same amount to learn and to think about when writing code, but Rust will give you a helpful compile-time error while C++ will let you blow your foot off.




> but Rust will give you a helpful compile-time error while C++ will let you blow your foot off.

But Rust can actually analyze trivially when this happens, while it is not possible with C++ due to language semantics.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: