Lurker News
Do you have some good advice or know any useful resources to learn in a proper way how to code in C++? For the context, I know some C, but C++ seems a different kind of beast, and it's easy to get lost in the huge variety of features and libraries it offers.

Comments (173) 47 threads

Show all comments

Showing thread 45 of 47

ronreiter5 replies#
May I ask why do you want to learn modern C++?

You should check out Rust, it aims to replace C++ and do a better job in memory management, and developer experience in general (cross-platform compatibility, package management, etc)

maxxxxx#
One motivation to learn C÷÷ could be to find a job. Rust looks interesting but C++ is still vastly more popular.
jxub#
Mostly because of adoption. Rust is great, but I'm not really into it (subjectively).
sjapkee2 replies#
>replace C++

No one can replace it, but everyone has to try.

bigcheesegs2 replies#
Rust is the first language I've seen that even has a chance though.
yoz-y8 replies#
Languages rarely get replaced though. We are just adding to the pile.

Continue this thread — 8 replies

ahartmetz7 replies#
Yup. D had a shot, but they screwed it up with (effectively) mandatory garbage collection.

Ada also had a shot, I think, but they screwed it up with no C compatibility and expensive SDKs - or something. For some reason, Ada is just not perceived as "cool". It actually seems like a pretty good language!

Continue this thread — 7 replies

Froyoh#
Java?
pjmlp2 replies#
Rust still needs to catch up with C++ in a few domains.

SIMD, GPGPU, GUI, embedded platforms, iOS, Android, UWP, COM, certified compilers, ...

xfer1 reply#
what do you mean by "certified" compiler here?
hsivonen1 reply#
As a programmer using the compiler, how does the IAR compiler quality feel in practice compared to GCC or clang?

Continue this thread — 1 reply

steveklabnik1 reply#
Incidentally, SIMD is just waiting on stabilization now; it’s RFC was accepted and the implementation landed. Soon!
AnimalMuppet4 replies#
Will Rust have idioms for really doing SIMD in Rust? If I understand correctly, C++ has to drop into assembly to do SIMD (at least so far).

Continue this thread — 4 replies

cpburns20092 replies#
I'm not the OP, but I'm tempted to learn more C++ so that I can directly use Qt without relying on language bindings for it. I like the idea of Rust, and maybe some day I'll tinker with it, but it looks like it has quite the steep learning curve.
steveklabnik1 reply#
First of all, I should say that I feel like bringing up Rust in this thread is inappropriate, and I’m glad the OP was downvoted.

To comment briefly on the learning curve, the trade off is basically, C++ is easier to get started, but harder on the high end. Rust is a bit harder for C people to get started, but then the high end is much easier. Rust’s curve is flatter, in a sense.
Oh and also: learning one will certainly help you learn the other in many cases. I advocate learning many languages :)
This week I’m visiting a ~700 person company in London that’s moving away from C and towards Rust. They’re not doing a Big Rewrite, obviously, so they still have quite a bit of C too. They chose Rust over C++ though. It always depends!

carlmr3 replies#
>Oh and also: learning one will certainly help you learn the other in many cases. I advocate learning many languages :)

Especially the Rust borrow checker will make you mad in the first place, and then teach you something about memory management you will be able to use in C++. It really improves your mental model in places you didn't expect.

Continue this thread — 3 replies

leetcrew1 reply#
if you aren't already very familiar with c, i would say the learning curves for c++ and rust are pretty similar. it will take you longer to get stuff to compile in rust, but correcting instances of undefined behavior in c++ can also take a long time in c++.
cpburns20091 reply#
I know enough of the basics of C and C++, and their standard libraries to shoot myself in the foot with, and I'm sure invoke undefined behavior in the process (I do realize they are separate but related languages). Rust on the other hand appears to be a completely different paradigm from my primary experience which is in managed languages (e.g., Python, Java, etc.). In particular the borrow checker, while a marvelous idea, I think would pose a quite the challenge to get accustomed to.

Continue this thread — 1 reply