8 ms·
I'd argue that Rust is meaningfully simpler than C++. Mind you, it's also a fairly feature-rich language, but the complexity of C++ comes from decades of new fe
by bccdee 6y ago
I'd argue that Rust is meaningfully simpler than C++. Mind you, it's also a fairly feature-rich language, but the complexity of C++ comes from decades of new features building up trying to supersede older features. C++ is several different languages by now depending on which feature set you use, but Rust is still just one language.
C++'s complexity is also a product of design choices like using templates to do both generics and metaprogramming, which in hindsight probably made things much harder than they needed to be. Rust has the benefit of being able to avoid decades of C++'s missteps.
- AnIdiotOnTheNet 6y agoI don't know much about Rust, because it doesn't seem to be the kind of language I want to use, so I can't personally speak to its complexity. However, I do know that a lot of objections to it from the people I follow are around the borrow checker and both the friction and high[0] compile times it causes. [0] to put that in context, Jon is frequently annoyed by the sub-second linking time incurred by LLVM because it is more than an order of magnitude longer than his largest program (~60k line game, IIRC) takes to compile.
- shrimp_emoji 6y agoRust is like a modernized, more well-furnished (and more ergonomic and secure) C. That may sound like C++, but C++ is also the most complicated programming language in existence. What makes it worse is that complication doesn't even exist for "good" technological reasons; it only exists for inertial, industrial reasons like compatibility with C and 1980s naivete -- both because of and in spite of it, since, like the other person said, even more complexity was bolted on to try to force new lessons without breaking backwards compatibility. I used to love C++, since I thought its complexity was somehow, fundamentally necessary for a lang to be a "fancier C". Once I learned Rust and found out that was not true, I now hate C++ with a passion and can't wait until it completely displaces C++, which it should do ASAP[0]. :D THAT SAID, some people (who are much better programmers than I am), say that C++ is the most expressively versatile language around, which is at least a "good" technological reason for its enduring existence. That's one I can't relate to, though, since the people who are saying that tend to be talking about very advanced, byzantine aspects of C++ that I never got to. 0: https://i.imgur.com/tbEohzT.png https://i.imgur.com/tbEohzT.png
- bccdee 6y agoThe borrow-checker is a big source of frustration for beginners, because it forces you to write code differently, so it takes a lot of getting used to. But I don't think I would characterize it as a source of complexity in the language. Frankly, once you get used to it, it makes the language simpler, because it means you don't need to worry about shared mutability. The complexity that does exist tends to come from the zero-cost no-copy abstractions which rust is so fond of, or `unsafe`, which exposes you to a whole world of complexity which safe rust protects you from.