Live data from Hacker News

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

news.ycombinator.com

21–30 of 161 posts

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

#21
post #19

Yeah, the unreasonable C++ hate is real. That said, from the modern perspective, the old versions of C++ do suck very much. If you're not even acquainted with C++11 yet, you should definitely check out C++20. Rust is less expressive than C, but likewise it does give less chances to shoot yourself in the foot. C++ is often derided for its complexity, arising from its long development. While it's true that C++ allows m…

I learnt it at university back then, but I had already toyed with C++11 so I always made puns and called what they were teaching C--. Essentially they were teaching a very old version and the evaluation machines ignored all the "modern" bits back then.

My idea is to either C++20 (not sure if there is a resource to learn directly from C++20 or if there are compilers supporting it) or Rust, personally I would go for C++ seeing as there's a wider ecosystem and tools out there, lots of libraries (which are a bit of a pain to use sometimes) and it is almost anywhere.

But to be fair, I am out of the loop of C++/Rust and what I see in my internet circles is Rust > C++ mostly because of the memory safety; which makes me wonder if it is worth or not; also lots of C++ hate which reminds me of PHP.

I just have a hard time making decisions.

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

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

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

#24
post #19

Yeah, the unreasonable C++ hate is real. That said, from the modern perspective, the old versions of C++ do suck very much. If you're not even acquainted with C++11 yet, you should definitely check out C++20. Rust is less expressive than C, but likewise it does give less chances to shoot yourself in the foot. C++ is often derided for its complexity, arising from its long development. While it's true that C++ allows m…

I learnt it at university back then, but I had already toyed with C++11 so I always made puns and called what they were teaching C--. Essentially they were teaching a very old version and the evaluation machines ignored all the "modern" bits back then. My idea is to either C++20 (not sure if there is a resource to learn directly from C++20 or if there are compilers supporting it) or Rust, personally I would go for C+…

By the end of the day your employer will decide which language/version is to be used on a project, so you should check with your employer. That said, even C++98/03 is well an alive; as a consultant I still see a lot of industry projects using C++98/03, some with a few elements of C++11; I rarely see C++17 and never see Rust projects.

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

#25
Depends on which area you want to work on, anything related with GPGPU, HPC/HFT, GUI tooling, LLVM/GCC infrastructure will be focused on C++ for at least one decade, or more still.

For Cloud Native stuff, Rust might be a better option, specially due to the security focus.

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

#26
It's a bit of a dilemma if we are talking about landing a job here.

With C++ you'll have more offers, but you are more likely to be unsatisfied with your job: in large corps you'll usually have to untangle lots of messy legacy codes; while in start-ups things are more likely to be done quick and dirty and the flexibility C++ provides doesn't make it any better.

With Rust unless you are in the US, it's gonna be extremely difficult for you to find an opportunity; even in the US I gather there are not many chances and I _guess_ recruiters would expect higher proficiency as Rust is known for its steep learning curve.

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

#27

Earlier quoted context omitted.

> Most real-world code (by number of codes and lines of code) is something else than C/C++ nowadays, just because of developer velocity and a larger hiring pool. This is simply not true. Examples of major software that is being actively developed: - Lots of compilers/runtimes (gcc, LLVM (which Rust builds upon), Java/JDK/JVM, Swift, node.js) - All major browsers and browser engines (Chrome/Chromium, Firefox, WebKit)…

Again, this is a tiny portion of actual coders. The amount of people actually _making_ compilers and runtimes is multiple orders of magnitude smaller than the people using them. Same with browser engines and game engines. For every coder doing the actual engine, there are a hundred others just using the engine, not touching C++. You did list a pretty substantial portion of the segments where C++ is a valid choice and…

When the car's automatic gearbox breaks down, it is nice that there are some mechanics around.

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

#29
What is your objective? If it's to be exposed to new ideas, I suspect that you will find Rust more interesting. In general Rust's notions of ownership/borrowing will be new to anyone, but to a Python/Go/C programmer like yourself I suspect you will also enjoy learning about tagged unions (what Rust calls "enums"), pattern matching, and expression-oriented programming (e.g. how `if` can be used directly as a ternary operator).

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

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

This seems like a weird statement. Yes, C++ has a load of features you can't express in a C API. But so does Rust! Yes, Rust can produce and consume libraries with a C API. But so can C++! They're in pretty much identical positions here, aren't they?

It's true that serde is great, and C++ doesn't have an equivalent (AFAIK). But C++ does typically have excellent piecemeal support for popular serialisation formats.

Post reply on HN