Re:Ask HN: Is Learning Rust a Must?
by sumanthvepa on Saturday July 17, 2021 @01:21PM
(#27867278)
One thing I think I missed, was how pleasant it it is to program in modern C++. There are no pointers, for the most part completely automatic memory management (with the RAAI) idiom. Build systems are still a pain. I recently built a physics simulator for an n-body type interaction problem in C++. Not a a large program (about 40K lines of code) but the experience was extremely pleasant. For build I used a combination of make for Linux and macOS and nmake and VisualStudio projects. Debuggers on Linux are still a bit bad. GDB with Emacs is fine but, is somewhat primitive compared to VisualStudio and even Xcode. Other than that it was a joy to actually write in C++.
The primary reason, I think was because there was no legacy code I had to deal with.
Re:Ask HN: Is Learning Rust a Must?
by heavyset_go on Saturday July 17, 2021 @09:18PM
(#27870086)
Do you know of any good resources for picking up modern C++?
I’ve used this book in the past to learn modern C++: https://www.amazon.com/dp/1484233654/ref=cm_sw_r_cp_awdb_imm...
For greenfield projects I’d opt for Rust over C++.
And for those same reasons we know building C++ is giant pain in the butt.
Given the opportunity, I would seriously consider Rust when rearchitecting a system to peel off small bits I can do 100% RUST because I then can escape C++ dependency/cmake/DPKG/RPM hell to something closer to GO.
When I deal with old C++ code not brought up to current build spec at our place I can waste 30-40% of my time getting various things to build. Getting the old code into the new system is now easier, but I killed a week learning it. And should I have to deal with a library off the beaten path who's dependencies I don't know, getting it into the new build system will be a pain-plus because I will then have to find/compute/assess its dependencies.
Getting out from all this nonsense is, I think, is an undersold part of RUST. You still get static types, C++ performance, memory safety, and you get a running start to CDCI because at least getting the darn PR built is a 4 to 6 Phd job of hand holding C++ through dep management.