Hacker News new | ask | show | jobs
by andolanra 1976 days ago
Rust is a reasonably complex language, but—having programmed professionally in both—I don't think it's nearly as complex as C++. Rust features for the most part are orthogonal to each other, whereas C++ features tend to have weird interactions with each other that are really hard to track and understand. (The one place where Rust starts to get messier in terms of feature interactions is async Rust, but luckily you can program Rust just fine while ignoring the async features.)

Consider initialization: C++ has dozens of different ways of initializing objects that in turn interact in complicated ways with move semantics and references and so forth. Rust's initialization story by contrast is straightforward: you just make the thing you want to make using struct or enum literals and maybe wrap those initializers in functions if you want.

2 comments

I agree I just have to assume people comparing Rust to c++ never really used c++ professionally for any length of time. Rust is incredible simple coming from c++ there is normally only 2 or 3 ways to do something vs 5 + 4 more via templates. It takes longer to learn the symbols for lifetimes then to get a grasp of what you need to do to keep the borrow checker happy.
Rust is as complex as C++, but it hides features from use unless you know you need them.

If you use vanilla Rust, it honestly feels quite high level, almost like Ruby or Python.