Live data from Hacker News

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

news.ycombinator.com

101–110 of 161 posts

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

#101
post #94
post #90

Earlier quoted context omitted.

see? learn Rust, but yeah, also learn Zig, or whatever new flavor of the day. No thanks. I don't want my tool set to change every year. I got out of web dev exactly for that reason. I'll stick to my C++ or C, thanks.

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?

#102
post #98
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.

I agree, and let's not even start with operator overloading. Rust on the other hand seems to be a safe but also rather explicit language (a good thing not just for system programming).

I am talking about Rust, not C++

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

#103
post #93
post #89

I am personally not a fan of learning a language that does a bunch of "magic" behind the scenes for you, and basically tells you that you don't need to understand what is going on behind the scenes. That is the impression I get from Rust. I also have no interest in investing in a language that might no longer be hot in a few years. At least with C or C++ it will be here, until I'm retiring. The volume of software out…

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?

#104

I'd say C++ at this point in time. It's getting better by the day, yet it has decades of high quality projects and libs you can rely on. Each new version is better than the last. It may be irritating that few things are ever hard-deprecated, and you have to keep a list of current best practices. On the other hand, concepts, ranges, previously auto and constexpr, are all godsend and make for an expressive language tha…

One of the core benefits of C++ is that it is a high level language that's still super close to the hardware. Switching from C++ to other languages, if you have mastered C++, should largely be a question of "what things are automatically done for me" which is very different from "what are these new things I need to do" that you have to deal with when you switch between other languages.

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

#105
post #8

There is just not enough information in your post in what you want to do with your knowledge. If you have a long time horizon, Rust is the safer bet, if you want a job fast, C++ has probably more job offers.

> If you have a long time horizon, Rust is the safer bet

I mean, maybe. Or maybe it gets replaced by something else.

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

#106
post #73
post #66

Earlier quoted context omitted.

Counterpoint: Zig is unstable (as in, Stick to C++ or Rust, which I won’t weigh in on here. But both are much more mature.

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 many people describe Go. I think Zig is a very attractive option for allocation sensitive programs like games, audio, or purpose-built data stores. Give it a look and decide for yourself.

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

#107
post #30

C++ has a myriad of wonderful language features that exist entirely within C++ and cross no language boundaries. I really adore C++ as a language but unfortunately I find little pragmatic use for it unless I'm working 100% inside C++ and using native APIs only. If you're doing that, it's a dream. Rust, on the other hand, speaks the same ABI as C, and with serde, can read and write to most formats and/or APIs with utm…

> C++ has a myriad of wonderful language features that exist entirely within C++ and cross no language boundaries. I really adore C++ as a language but unfortunately I find little pragmatic use for it unless I'm working 100% inside C++ and using native APIs only. If you're doing that, it's a dream. Rust, on the other hand, speaks the same ABI as C, and with serde, can read and write to most formats and/or APIs with u…

It's possible to have some parts of what serde does if you restrict yourself to aggregates (no private members, no explicit constructors), e.g. your types are simple structs such as

     struct foo { int x; std::string label; };
Here it's possible to serialize/deserialize this structure in a generic way without having to annotate it - currently it's a bit complicated to implement so libraries help doing it (e.g.https://github.com/apolukhin/pfr_non_boost) but in 23 the missing language feature that makes the code trivial to write without any library should be there.

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

#108
post #51

> I see a lot of criticism/hate of C++ lately (mostly due to the comittee), but the tooling and libraries are there for multiple areas. I like C++ and my main caveat is that you don't just write C++. You also have to get good at tools like Valgrind and develop a deep intuition and understanding of what the language does under the hood. That's going to require a significant time investment and some people just don't h…

Surely in any language you would have to learn tooling ? What happens when your user report performance problems on Python, Java or JS programs, you surely use some profiling tool there, no ?

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

#109

I would choose Rust. Today it might be that the market has more jobs on C++ and there are more codebases. In the future, those codebases will only be the legacy ones and you will end up doing more maintenance with C++. With Rust your investment of today will pay off in a few years. Deciding what to learn today is an investment decision and you should look into what you think the future will look like. To me it looks…

I'm sure exactly the same comment can be found on Slashdot in 1997 with "Java" instead of "Rust"

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

#110
post #95
post #83

For current job availability, C++. For enjoyment (in my case) and potential future jobs (not guaranteed), Rust. C++ is tried and true and it's proven itself for sure. Rust is just more fun to work with for me though. Lots of good tooling and documentation for both as well.

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
Post reply on HN