Live data from Hacker News

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

news.ycombinator.com

101–110 of 184 posts

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

#101
C++ is just C with extra notation for easy modeling of Classes and Objects. While C still remains valuable, C++ is in my opinion questionable and there are many excellent alternatives like Java or C# for doing similar things and much more. I have programmed in C++ for many years and honestly would not suggest it to any one but anyway here are some excellent resources.

ftp://bitsavers.informatik.uni-stuttgart.de/pdf/borland/borland_C++/Borland_C++_Version_2.0_Getting_Started_1991.pdf (Read chapter 4 C++Primer. The hole folder is a rare jewel)

https://docs.microsoft.com/en-us/cpp/cpp/cpp-language-refere... Probably the best documentation of C++ by far.

P.S. If you are desperate on learning C++ I could give short course saving you time and money.

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

#102

IMO, the classic C++ book/author is still the best: Effective C++. Don't forget about the sequels, including the mostly overlooked Effective STL (which I happen to like better than the first two books). And to address the modern part of this question, I'll add that Scott Meyers has written Effective Modern C++ as well, but I'd read that last after getting the hang of C++03. No matter what people say, I tend to believ…

IMO, Effective C++ is just a collection of warnings about pitfalls, something that is unfortunately needed for C++ programming, so do read it. But it is neither an introduction nor a collection of big picture advice.

That is arguably true for the first two books, but Effective STL is very opiniated. Scott Meyers argues not to use for loops when possible and to use the algorithm library everywhere instead. I tried convincing my team to do this but we were using C++03 and writing a struct functor is no fun... I think in C++11 a for loop and even a for each loop should be modernized with a good lambda instead.

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

#104
post #101

C++ is just C with extra notation for easy modeling of Classes and Objects. While C still remains valuable, C++ is in my opinion questionable and there are many excellent alternatives like Java or C# for doing similar things and much more. I have programmed in C++ for many years and honestly would not suggest it to any one but anyway here are some excellent resources. ftp://bitsavers.informatik.uni-stuttgart.de/pdf/b…

> C++ is just C with extra notation for easy modeling of Classes and Objects.

That's far from true today, and I'd even argue it hasn't been true since very early on. Simple example to prove my point: RAII.

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

#105
post #94

Earlier quoted context omitted.

I agree with this completely :) I would also like to add that it helps to read "The Design and Evolution of C++". I found that I plateaued early in my C++ journey. However, I was always reading from the experts and it really helped to read material from Dr. Stroustrup. Once I began to see the common thread behind what he was saying and understood why some things were the way they were, it helped understand when it's…

> I would also like to add that it helps to read "The Design and Evolution of C++". I think that book is worth reading even to people who have no intention of going anywhere near C++, as long as they are interested in programming language design and evolution. I wish there were more books like this one to explain the kind of thinking that went into the design of a language and to tell its history.

Agreed.

I had commented on the book on HN about a month ago:

https://news.ycombinator.com/item?id=16275341

Excerpt from it:

"I found that book very interesting in many regards. I had bought and read it several years ago (out of interest, though I have not worked on C++ professionally).

Stroustrup goes into a lot of details about the reasons for many design decisions in the language."

That's one of the reasons that make the book interesting. He even goes into human and cultural aspects of programming.

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

#106
post #13

Earlier quoted context omitted.

Rust still needs to catch up with C++ in a few domains. SIMD, GPGPU, GUI, embedded platforms, iOS, Android, UWP, COM, certified compilers, ...

Incidentally, SIMD is just waiting on stabilization now; it’s RFC was accepted and the implementation landed. Soon!

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

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

#107
post #17

- Tour of C++ ( http://www.stroustrup.com/Tour.html ) - Principles and Practice Using C++ ( http://www.stroustrup.com/programming.html ) - From Mathematics to Generic Programming ( http://www.fm2gp.com/ ) - The Scott Meyers books Some of the Bjarne Stroustrup videos, "Learning and Teaching Modern C++" - https://www.youtube.com/watch?v=fX2W3nNjJIo Some of the Herb Sutter videos, "Writing Good C++14... By Default" - ht…

I'd like to recommend Jean Parents talks: https://www.youtube.com/watch?v=QGcVXgEVMJg&list=PLiWEEi8ezR...

They are truly great.

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

#109
I have a question on this topic which is - is it possible or practical to only learn "modern" C++?

Isn't it necessary to be able to understand pre-modern C++ in legacy code bases or to work alongside a co-worker who might code using an older style? Or even to be able to understand documentation and texts about C++ from an earlier era?

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

#110
post #44

Earlier quoted context omitted.

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

> Only systems programming languages that are bundled with OS SDKs survive on the market...

Hmm. To Rust, this would seem to say "get bundled or die".

In your view, is it enough to be a free download?

Post reply on HN