Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In what ways is it more complicated than C++?


The basic C++ you need to know to survive is quite small. Not as small as C, but let's say twice as large. There are some crazy complex parts in C++ but most people dont see those parts very often.

Rust on the other hand has a pretty huge base part that everyone needs to learn. Because certain normally simple things can get very complex in Rust and you start approaching the dark corners of the language very very quickly.

So yes, I belive Rust is more complicated that C++. And it is still growing


Interesting - I see your point, but in my experience the complexity most people reference in this context are things that are implicitly present in C++, like lifetimes.

That being said they do definitely make it hard to do certain types of things (data structures with cyclic references, etc). But that’s not quite complexity, that’s more of a constraint on expressing complexity

To me complexity comes from implicit lifetimes, operator overloading, turing-complete templates, unhygienic macros, lack of a blessed package manager/build system, many different types of implicit constructors/destructors used in different contexts, easy to hit language footguns, etc.

IMO lifetimes (and downstream interactions with things like async) are the most complex bit of Rust.

But for a fairly significant number of places in Rust projects you can avoid them. The same isn’t true for the complexities of C++ I listed above.




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

Search: