Live data from Hacker News

Ask HN: Learn C++11 or Rust in 2022?

news.ycombinator.com

111–120 of 161 posts

Re: Ask HN: Learn C++11 or Rust in 2022?

#111
post #97

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.

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?

#112
post #73

Earlier 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…

D had a couple of such SaaS and doesn't seem to have helped much in the end.

Re: Ask HN: Learn C++11 or Rust in 2022?

#113
post #103
post #93

Earlier 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.

I remember, it is running on all the mobile phones around the house, on the TV, on the blueray player, and apparently Amazon needs it to deliver my packages, Netflix to manage the next movie I want to watch,...

Re: Ask HN: Learn C++11 or Rust in 2022?

#114
post #80

Earlier 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.

Unfortunely, only when working solo, or with a team that really embraces security.

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?

#115
post #88
post #82

Earlier 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.

I know C++ since 1993, I am quite curious how pointer semantics have anything to do with RAII.

Re: Ask HN: Learn C++11 or Rust in 2022?

#116
post #103
post #93

Earlier 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.

I agree java forces a set of constructs, but it's a clear win for c++ - it has far too many constructs that interact in incredibly subtle and complex ways. And it will only get worse over time as they accumulate. At least I can obtain a fairly good mental model for what Java does without being a wizard.

Re: Ask HN: Learn C++11 or Rust in 2022?

#117
post #111
post #97

Earlier 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.

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.

Re: Ask HN: Learn C++11 or Rust in 2022?

#118
post #101
post #94

Earlier quoted context omitted.

And your software will continue to have memory safety issues.

memory safety issues are the result of poor software engineering.

History has demonstrated over and over and over again that c/c++ code above a certain complexity threshold (which is fairly low), _will_ have memory safety issues. It doesn't matter how good you are at engineering.

Re: Ask HN: Learn C++11 or Rust in 2022?

#119
post #95

Earlier 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

I'm not sure the history of software driven avionics and space accidents really support that as an argument for their safety?

Re: Ask HN: Learn C++11 or Rust in 2022?

#120
post #117
post #111

Earlier 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.

Indeed, however memory-safe c++ isn't on the top list of what makes GPGPU, HPC/HFT, LLVM/GCC relevant in the industry, as such, those ecosystems won't be jumping into Rust anytime soon.

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,....

Post reply on HN