Which language gives users more control, C++ or Rust

I have been thinking about this question quite a bit in time I should have been sleeping...

Once apon a time I programmed extensively and deeply in C++. Loved it. I loved the freedom and the access to low level programming with high level tools (like the STL) at my finger tips.

Coming to Rust I was offended (truly) by having the case and style of variable names being commented on by the compiler. (In the day I had my on style). I have spent long times struggling with the borrow checker. I am used to using my own style of memory management and was proud that I did not trigger memory leaks.

I am still a beginner in Rust, I still have not got the idiom down pat. But, older and wiser, I have gotten over myself and I appreciate the need for the restrictions enforced by Rust. I am over my own hubris and find that if I toe the Rust line I will be as productive in Rust as I as in C++. And I will have the same very low run time overhead and rich data types.

I do not think I am answering the question as asked (I think related to control over hardware) but IMHO Rust gives much less expressiveness, I have much less control over my programming paradigms (I do not have the control given by C/C++ pointers). But in return I have a much smaller ball of string to unravel. In C++ there I had control over every aspect of the programmes I wrote. To the point where, even in 2001 when I left C++ behind, people were strictly subsetting C++ so a group could work on it and understand each others code. (Every group seemed to have a different subset). Over the years C++ has become a place to put every programming concept and style. That is (was?) its purpose, but has made it so huge that it is unwieldy.

Rust gives me much less control. I am re-factoring my code constantly to keep the borrow checker happy. And my code is better for it.

I am old and grey. I never thought I would see anything in computing that ould really impress me like the STL did in 1997. But by golly you've done it with Rust.

So I am happy to abandon the control that C++ gave me. I liked it, but it as the zero cost (mostly) abstractions that was what I really appreciated in C++. In Rust I have them still, and it is making me a better programmer.

Yay for Rust!!

15 Likes