Earlier quoted context omitted.
Honestly, I think the shift you are already seeing is from C++ -> a GCed language (python, javascript, java). While C/C++ are everywhere, they are mostly in very low level places. You don't find a lot of new backend projects that go the C++ route. Rust will likely eat up a significant chunk of C++'s current market share and SOME of the backend service market share (where CPU and Memory are REALLY important). However,…
If I was in a situation where c++ made sense for a greenfield project, rust would almost certainly be a better choice.
Ask HN: Learn C++11 or Rust in 2022?
111–120 of 161 posts
Re: Ask HN: Learn C++11 or Rust in 2022?
#112Earlier quoted context omitted.
Also there's no job market for it.
I don't think Zig is recommended for production use. It's not at 1.0.0 yet. That said, there are at least three stealth-mode SaaS companies I know of betting on Zig for their performance sensitive / low-latency software. Where I work, we're tracking Zig's nightly build and follow/contribute to Zig progress and stability roadmap. Zig hits a sweet spot between C and C++. It feels really nice to work in -- in a way that…
Re: Ask HN: Learn C++11 or Rust in 2022?
#113Earlier quoted context omitted.
It’s funny because I get the magic impression from c++ but not from rust. Stuff like copy semantics in C++ is so absurd. Rust is explicit and by design not particularly magical.
at least c++ doesn't force constructs onto you. remember java? that language was a fad too that didnt' go anywhere, because it forced object-oriented programming onto the user.
Re: Ask HN: Learn C++11 or Rust in 2022?
#114Earlier quoted context omitted.
> With C++ realistically memory management is so hard Honest question as I'm not a C++ developer: Even with all the new C++17/20 stuff?
Problems with memory management are a fading memory when coding modern C++. All the things Rust advocates insist cannot be done safely in C++ are now trivial. Use-after-free, leaks, buffer overruns, what-have-you, no longer need any attention to avoid if you stick to modern C++. Some people insist on coding as if it were C, and bring along all of C's failings. Leave them behind.
Those people that insist on coding as if it were C are still a very big group across the industry.
Re: Ask HN: Learn C++11 or Rust in 2022?
#115Earlier quoted context omitted.
Starting with C is the worst way to learn C++. You start out with bad habits you then have to unlearn. Unlearning bad C habits is hard because the language accommodates them for as long as you continue to cling to them. You need to consciously decide you will use the new, better way. Once you have done each once, there will be no temptation to backslide.
Fully disagree. Understanding pointer semantics is a pre-requisite for understanding RAII.
Re: Ask HN: Learn C++11 or Rust in 2022?
#116Earlier quoted context omitted.
It’s funny because I get the magic impression from c++ but not from rust. Stuff like copy semantics in C++ is so absurd. Rust is explicit and by design not particularly magical.
at least c++ doesn't force constructs onto you. remember java? that language was a fad too that didnt' go anywhere, because it forced object-oriented programming onto the user.
Re: Ask HN: Learn C++11 or Rust in 2022?
#117Earlier quoted context omitted.
If I was in a situation where c++ made sense for a greenfield project, rust would almost certainly be a better choice.
Except not having the libraries, IDE tooling and graphical debuggers that make C++ still relevant.
Re: Ask HN: Learn C++11 or Rust in 2022?
#118Earlier quoted context omitted.
And your software will continue to have memory safety issues.
memory safety issues are the result of poor software engineering.
Re: Ask HN: Learn C++11 or Rust in 2022?
#119Earlier quoted context omitted.
C/C++ have proven themselves impossible to write in a secure manner at any useful scale. The evidence is overwhelming.
C and C++ are the most common languages in avionics and space
Re: Ask HN: Learn C++11 or Rust in 2022?
#120Earlier quoted context omitted.
Except not having the libraries, IDE tooling and graphical debuggers that make C++ still relevant.
I agree those are downsides. But I think memory safety matters more in the problem space where c++ is relevant. I understand that's debatable, but I think the historical evidence suggests that it is impossible to write memory-safe c++ code beyond a fairly low complexity threshold.
Some recent examples, Apple recently added support for using Metal from C++ instead of Swift secure bindings, Android now supports Rust at the OEM layer, no roadmap for NDK/AGK support for anything beyond C and C++, Azure Sphere is "secure" yet SDK is all about C and C++ (no Rust plans), Khronos API ecosystem is all about C and C++, CUDA,....