4 ms·
I'll take a contrarian view. C++ which Rust proponents usually target for replacement, is an extremely well tested language. In any real commercial application
by sumanthvepa 5y ago
I'll take a contrarian view. C++ which Rust proponents usually target for replacement, is an extremely well tested language. In any real commercial application where a system programming language is needed, C++ would usually be a better choice if you know the language. If don't know C++, learn Rust, it's probably easier, and you'll make progress faster. But Modern C++ is extraordinarily powerful -- it may be worth learning to build some high performance systems like games and browsers.
- scrubs 5y agoThis is good advise. Our large shop has so much C++ nobody here is gonna run and hide from it. Our libs are large, in large numbers. So not having C++ is a disadvantage. 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.
- sumanthvepa 5y agoOne 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.
- heavyset_go 5y agoDo you know of any good resources for picking up modern C++?
- jguzmanjr 5y agoI’ve used this book in the past to learn modern C++: https://www.amazon.com/dp/1484233654/ref=cm_sw_r_cp_awdb_imm_JXM737Z80N5H9XXKS8FN https://www.amazon.com/dp/1484233654/ref=cm_sw_r_cp_awdb_imm... For greenfield projects I’d opt for Rust over C++.