Hacker News new | ask | show | jobs
by 0815test 2541 days ago
Rust is a lot simpler than C++. Broadly speaking. the only 'complications' it has over C are those that are actually needed to support its patterns of memory-safety-guarantees-through-RAII. The only real alternative is GC languages, and those have their own sorts of very real complications that do absolutely scare off performance-oriented folks.

The biggest problem with Rust right now is actually its novelty and lack of maturity, that makes using it at this time a lot more problematic than it should be. But Java and Python were once "new and unproven" languages, too.

3 comments

While I agree in general, just wanted to make the heads up that not all GC enable languages are made alike and a couple of them do allow for C style low level programming.

Usually the performance folks that get scared are the ones that put all of them into the same basket.

There is certainly much more accumulated cruft in C++, but you can write your C++ program ignoring most of it. You will have to deal with some of Rust's harder parts rather soon.
You can write a C++ program ignoring most of it, but when you go to work on someone else's C++ program, or import someone else's C++ code (i.e. most real-world programming) you will have to deal with it.

And when you're not working alone you will spend a lot of energy discussing which C++ subset you will use, and enforcing that.

C++ has accumulated complexity over decades, and the committee is working on making things easier for beginners. Usually it works, mine-fields like string_view aside.

Rust has accumulated its complexity over four years, and it's already comparable to C++. The thing that worries me the most about Rust, is how the language will look like in another 10 years.

> Rust has accumulated its complexity over four years, and it's already comparable to C++.

It’s not. C++ constructors alone rival the entirety of rust, and grow in complexity with every release.

You’re just so used to the unfathomable complexity of c++ you don’t realise it exists anymore.

Something which is explainable in one cppreference wiki page is not as complex as an entire language, which is described in a 550+ page book.
C++ is so complex no-one can really grasp how complex the language actually is.

C++ is not slowing down. C++ is on the verge of deprecating STL-style iterators in favour of Ranges, and modules and concepts are imminent. Template metaprogramming is being superceded by constexpr. Of course STL iterators, header files, and template metaprogramming are still going to be around, people will just need to learn all of it if they want to work on a variety of C++ projects.

STL-style iterators are not deprecated, just like LINQ and streams have not deprecated interactors on .NET and Java respectively.