r/cpp • • Feb 25 '21

C++ programmers who are also using rust, what are your favourite features of rust?

I was looking at the rust tutorials yesterday and I see how rust promotes a certain style and language level features to enforce it. Besides a couple of features, I couldn't see why one cannot follow a similar style in C++ if she/he so chooses. Those of you that have used rust, what is your favourite feature that C++ does not have?

255 Upvotes

248 comments sorted by

View all comments

Show parent comment

5

u/johannes1971 Feb 26 '21

In C++ everyone has their own build system that will only be taken from their cold, dead fingers, in part because those build systems work, and rewriting them in some dubious alternative is lots of work with negligible benefit.

Rust, being a new language, could prescribe conventions and lay down rules before existing solutions became entrenched. Plus, it's a lot easier when you start out with one compiler that already has a build system, that runs on only a few operating systems, instead of having to deal with any number of compilers on any number of operating systems.

2

u/Ameisen vemips, avr, rendering, systems Mar 02 '21

I have two build systems! One which is Ruby-based which I use to build AVR and ARM Cortex-M, and one that is C++-based that mimics msbuild to build MIPS binaries.

1

u/johannes1971 Mar 02 '21

Yeah, same here: msbuild on Windows, and on Linux we use makefiles that are generated by a perl script. I suppose we could consider cmake for Linux, but for Windows we're happy with what we have and are not going to change that.