Live data from Hacker News

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

news.ycombinator.com

81–90 of 161 posts

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

#82
post #22

C++20 is going to be much friendlier. If you're new to C-like languages though, perhaps start with C and work up to C++. The foundations are important to understand, and you'll appreciate why RAII is important. EDIT: Ah yes, the "crawww C is unsafe, use rust crawww!" downvote crowd is out in full force today.

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.

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

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

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

#84
The smart thing to do is to bet against the herd on HN. Otherwise, facebook would've ceased to exist, everybody would be using ruby and crypto would be worth $0. Bookies love to bet against the herd for a reason.

> I see a lot of criticism/hate of C++ lately

Should tell you something. It's not like agenda driven PR campaigns are new to social media. Whenever I see a wave of criticism or praise on social media, I think to myself, what would paul graham do?

If your job is Python/Golang/C why do you want to learn C++ or Rust? Learn neither. Why not learn a functional language or SQL instead? Or delve deeper into python or go or c.

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

#85
It depends on what your objective is. I assume you want to expand your skillset for the future. C++ is good because there's tons of legacy C++ code out there, and companies will need people to maintain it for decades to come. Rust is good because it's trendy and looks good on a resume. Do note, however, that C++ and Rust skills are unlikely to be valuable at the same kinds of companies.

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

#86
I’ll remark that _both_ of them have a very different aesthetic from Python, Golang & C, all of which aim for a certain simplicity of syntactic structure, whilst Rust and C++ both go for “power through the type system”. If you want a language that shares that aesthetic, you might be better off looking at JavaScript.

As others have remarked, there’s a lot more C++ gigs out there. I don’t think knowing C is actually much of an advantage to learning C++ though, the idioms and libraries are too different. Personally, I like Rust, it’s got a great community and the language feels “next-gen” in a way C++ never will.

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

#87
post #44

Not for everybody, and I’m sure it’s not the most efficient way to approach it, but I personally felt that learning modern C++ was a good intermediate step before learning Rust. Going to rust directly has been a very frustrating experience and made me give up. Instead I spent time learning C++, I found out I could more easily transfer my knowledge/skills there. Once you become more proficient with the basics you lear…

I had the same experience. Went to rust from a memory managed language, had no idea why people liked it so much. Then, I had to learn some Delphi (and not 10, like 7 compatible), and coming back to Rust was a breath of fresh air, and I understood the value in the ownership system.

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

#88
post #82
post #22

C++20 is going to be much friendlier. If you're new to C-like languages though, perhaps start with C and work up to C++. The foundations are important to understand, and you'll appreciate why RAII is important. EDIT: Ah yes, the "crawww C is unsafe, use rust crawww!" downvote crowd is out in full force today.

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?

#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 there written in those language is massive and most "new" software engineers will not be able to deal with it as they have been brought up on python, javascript, java or whatever the new flavor of the day is.

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

#90
post #2

Between C++ and Rust, my bet would be that you decide Rust. But—also learn Zig in addition to Rust. Having seen first-hand how so many threat vectors these days are now supply chain attacks, having reported CVEs and earned P1 bounties in memory safe languages, and having worked on static analysis systems to detect zero day exploits—I'm also impressed by Zig's overall approach towards safety, as being more than only m…

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