Live data from Hacker News

Ask HN: Best way to learn modern C++?

news.ycombinator.com

41–50 of 184 posts

Re: Ask HN: Best way to learn modern C++?

#41
If you want fun miniproject may I suggest Peter Shirley's excellent mini-raytracing bookseries: Ray Tracing In One Weekend, Ray tracing the next week, and Ray Tracing, the Rest of Your Life: https://www.amazon.com/Ray-Tracing-Weekend-Minibooks-Book-eb...

If you get interested on rendering Matt Pharr & Co's Oscar winning "Physically based rendering" is a didactic masterpiece. https://www.amazon.com/Physically-Based-Rendering-Third-Impl...

The book is one of the best examples of how to combine high quality code and academic exposition together.

Re: Ask HN: Best way to learn modern C++?

#42
Do you mind asking 'Why C++'?

I know that doesn't answer your question and to be honest, I am curious about the resources which come up here too, but C++ can be so painful to learn that I wanted to know what drives you into that direction. I mean, there are alternatives like Rust. Do you have a specific project in mind, need it to fulfill some résumé requirements or something completely different?

Re: Ask HN: Best way to learn modern C++?

#43
post #42

Do you mind asking 'Why C++'? I know that doesn't answer your question and to be honest, I am curious about the resources which come up here too, but C++ can be so painful to learn that I wanted to know what drives you into that direction. I mean, there are alternatives like Rust. Do you have a specific project in mind, need it to fulfill some résumé requirements or something completely different?

Not OP, but good question.

I find Rust is a much better language, but there are very few mature libraries right now if you do something outside the scope of what Mozilla is doing. Also very few companies that are working in Rust (AFAIK, if you know some let me know) looking for devs.

If you want to work in a company that is doing any kind of low level code you will either need C or C++ as a foundation. At least to understand existing code. Most companies won't just rewrite everything in Rust, no matter how good the language is.

I really hope Rust replaces C++ for new projects, but it's just too new to tell whether that will happen. I find there's a bit more momentum (and good ideas) than in D, but nobody can predict the future from 2-3 years of language history.

Re: Ask HN: Best way to learn modern C++?

#44

Earlier quoted context omitted.

Rust is the first language I've seen that even has a chance though.

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!

The issue with D is not mandatory garbage collection, rather its quality and anti-GC religion.

Joe Duffy mentioned on his Rustconf talk that Windows devs even with Midori running in front of them, it was still a very hard sell for them to psychology accept it as doable.

The problem with Ada was basically expensive SDK, Pascal-like syntax and not being part of OS SDKs.

Only systems programming languages that are bundled with OS SDKs survive on the market, others either get a niche (Ada - high integrity systems) or fade into oblivion/maintenance (Modula-2, Delphi, ...).

The main reason being, companies already payed for OS SDK or gotten it for free with the OS.

Any other language must add a very worthwhile set of benefits for them to look beyond the SDK and possible toolchain integration issues.

Re: Ask HN: Best way to learn modern C++?

#45

Earlier quoted context omitted.

Rust is the first language I've seen that even has a chance though.

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!

ADA is really good, but too much word vomit and the compilers (used to?) cost a lot of money.

Re: Ask HN: Best way to learn modern C++?

#47
post #29
post #24

Earlier quoted context omitted.

what do you mean by "certified" compiler here?

In certain industries, specially where human lives are at stake you can only use certified compilers, where the kind of code they generate is validated against specific safety standards. For example, https://www.iar.com/iar-embedded-workbench/certified-tools-f...

As a programmer using the compiler, how does the IAR compiler quality feel in practice compared to GCC or clang?

Re: Ask HN: Best way to learn modern C++?

#48

Earlier quoted context omitted.

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.

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

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

Re: Ask HN: Best way to learn modern C++?

#49
post #15

Google's C++ course at https://developers.google.com/edu/c++/ looks useful to start with.

Don’t forget SFINAE. It’s what most of the modern type traits rely on and something you’d have to understand, at least conceptually, to fully understand how to effectively use things like std::enable_if.

Re: Ask HN: Best way to learn modern C++?

#50
post #18

Use it. Not being a smart@$$ here. Any language you want to learn will only become natural when you've used it for a significant project or set of exercises. Either clone or port something non trivial, or use it for your latest pet project, or get permission to use it at work.

I'd still argue that there's a lot of value in some form of teaching (via book or video or whatever). If left to their own devices, novices will often come up with messy, non-idiomatic ways to do things.
Post reply on HN