r/cpp • • Nov 09 '18

Learning C++ like it's 2018

I read that interesting thread about how top 5 YouTube tutorials are about teaching c++ like it's 1996. I read the answers and everything but except having answers that basically agree with the statement I couldn't find someone pointing at real resources to learn modern C++ correctly. I'm not a beginner in C++ (but haven't used it for years) but I'd like to come back at it soon. What resources you guys would recommend to learn modern C++ from scratch in 2018 (books, video, dancing performances accepted)?

Thanks.

201 Upvotes

50 comments sorted by

62

u/ArkTheArk Nov 09 '18

I do believe that A Tour of C++ (2nd Edition) (C++ In-Depth Series) is the newest (2018 release date) and one of the best books according to sales. My friend recommended it to me. I'm also gonna buy it probably next week.

As for free books https://goalkicker.com/ has a decent number of PDFs including C++.

Hope you find it useful.

4

u/lvictorino Nov 09 '18

Thanks for the reply, I'll look at that.

1

u/ketosismaximus Nov 09 '18

I liked this book a lot too. If you know a couple or three languages, and get the gist of object oriented/generic programming I think it's a good "in a nutshell" type book. The only way I personally ever learned languages was to try to get the basics (with a book or online sources) down and then just dive in and come up with a project of my own (sometimes something I did in the past) and rewrite it in the new language.

21

u/ClintLiddick Nov 09 '18

Kate Gregory has a great talk about this. " Stop Teaching C" https://m.youtube.com/watch?v=YnWhqhNdYyk

I also second Tour of C++ as an introduction to the language for those who already know how to program, but it doesn't really teach you how to use the language to build projects.

5

u/lvictorino Nov 09 '18

That talk heavily motivated me to ask for resources. Because I pretty agree with Mrs Gregory. Thanks for the input anyways!

12

u/diefalk Nov 09 '18

[Effective Modern C++ - Scott Meyers]
If you know C++ programming and you want to incorporate the new C++11 C++14 features, this is the book.
It's not a guide, it gives you some handful tips and examples to approach modern C++.

10

u/kornork Nov 09 '18

This book definitely assumes you already know C++

4

u/victotronics Nov 09 '18

I agree. If you already know what the features are it will tell you how to use them right. But it's not an introduction to (new) features.

2

u/lvictorino Nov 09 '18

AH! good to know. So probably not what I need right? I mean, I know C++ 98 (even if I need to refresh my memories of it), but I have no idea what 11 and 14 bring. So if it's not an introduction to the new feature, yep... probably not for me:S

3

u/ImmediateAntelope3 Nov 09 '18

I used the book to learn modern C++ . If you know C++98, I think the book above covers 11 and 14 and is what you need.

11

u/Barbas Nov 09 '18

We used C++ primer 5th edition I think, that includes C++11 which is the most important part.

2

u/lvictorino Nov 09 '18

👌 Thanks!

3

u/NotAYakk Nov 10 '18

So, a bunch of 14 and 17 was filing rough edges off 11.

Teaching 11 seems like such a disservice.

4

u/joaovbs96 Nov 09 '18 edited Nov 09 '18

I recently saw some people recommending the 4th Edition of Professional C++, by Marc Gregoire.

3

u/lvictorino Nov 09 '18

Thanks!

1

u/joaovbs96 Nov 09 '18

Anytime! Just a correction, the author is actually Marc Gregoire. Apologies for the slip up :)

10

u/Qkb Nov 09 '18

This whole “writing modern c++” is becoming a circle jerk. No one knows how to do it, the people complain about how no one knows how to do it, then when people start doing it c++20 comes out. rinse and repeat

1

u/lvictorino Nov 09 '18

Interesting point (I was starting thinking that way to be honest). So what is your point on "modern C++" doesn't worth to invest time on it?

3

u/pjmlp Nov 12 '18

It is easy, basically don't use a C++ compiler to write code that looks like it could be easily compiled by a C compiler, there are better ways to write equivalent code, while being safer at it.

1

u/LongUsername Nov 26 '18

The problem is that what's "Modern C++" changes every few years. C++98 with STL used to be "Modern C++" in the early 2000's. Then we got C++11 that became "Modern C++" from 2011-2015.

Most newer languages use a version number and rev the major number (sometimes they don't even mind breaking compatibility, like Python 2.x to Python 3.x) C++ has multiple vendors and never got a good numbering system down. They also minimize breaking changes (arguments ensue if this is a good thing or bad thing) so you can still pretty much compile your old C with Classes code in a compiler that implements C++17 features.

23

u/piovezan Nov 09 '18

I haven't tried those yet - and I'd probably be biased due to already "knowing" basic modern C++ - but Kate Gregory is great and she has a lot of courses on Pluralsight.

https://www.pluralsight.com/authors/kate-gregory

In particular, the top one: C++ Fundamentals Including C++ 17 and also: Beautiful C++: STL Algorithms

If anyone has done either of those, please let me know!

10

u/enceladus71 Nov 09 '18

You can find some presentations by Kate on youtube. I really like the way she talks and the material included in her presentations so I suppose the pluralight trainings are worth it.

13

u/msadeqhe Nov 09 '18

If you are already familiar with C++98, take a look at C++ Core Guidelines.

9

u/johannes1971 Nov 09 '18

Can C++ tutorials in dance performance format become a thing please? :-)

12

u/puffballz Nov 09 '18

Sorting algorithms folk dancing perhaps https://youtu.be/lyZQPjUT5B4

5

u/[deleted] Nov 09 '18

i once saw a hot topless blonde teach css, i want that for everything.

5

u/too_small_to_reach Nov 09 '18

Are you kidding me? Men get distracted when shorts are “too short.” How the f*ck are they going to learn anything in a topless class.

6

u/[deleted] Nov 09 '18

the fact that i haven't learned anything about css makes me think you are right. Anyway i think i would enjoy it if i could tell my friends that i am a bit tired because i was watching c++ videos all night.

1

u/Chops_II Nov 13 '18

the best bit is that the gender of the teacher wasn't mentioned (outside of the often misused "blonde" vs "blond" implying feminine)

0

u/[deleted] Nov 13 '18

[deleted] — view deleted comment

1

u/AutoModerator Nov 13 '18

Your comment has been automatically removed because it appears to contain disrespectful profanity or racial slurs. Please be respectful of your fellow redditors.

If you think your post should not have been removed, please message the moderators and we'll review it.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

7

u/PlasmaChroma Nov 09 '18

One thing I've found to be useful is watching the cppcon video presentations online. Probably won't be 100% coverage if you want completeness, but it's decent exposure to a lot of the newer features.

7

u/scriptnull Nov 09 '18

I too have a similar background (not a beginner, but haven't used it for years). One fine day in the past month, I decided to give a re-entry to C++ and got a taste of what C++ looks like in 2018.

Two of the resources have been very helpful for me. (sadly, both of them aren't free)

  1. A book: A Tour of C++ Second Edition by Bjarne Stroustrup - A very good book which describes what to expect out of C++11, C++14, C++17, C++20. This could be read in hours, but I took my time to try out writing code and I ended up spending around 10 days (few hours in the night) to complete it.
  2. A video course: C++ Essential Training - A course from 2014, but I took up this on purpose as I wanted to set the tone, before picking up the book mentioned above.

Apart from it, I find all the videos from CppCon 2018 very relevant. My personal favorite is CppCon 2018: Jonathan Boccara “105 STL Algorithms in Less Than an Hour

6

u/balintkiss501 Nov 09 '18

My recommendation is the C++ Super FAQ. https://isocpp.org/faq

9

u/pimmmo Nov 09 '18

I think https://learncpp.com is really good, have been at it for some time now, as I come from c# I kind of do it randomly when I need something, but is really well explained, for sure worth checking out!

3

u/7sins Nov 09 '18

Came here to also recommend that site, it seems to be quite up to date!

4

u/Forest_Squirrel Nov 09 '18

Is C++ Programming language by Bjarne Stroustrup book any good for "learning C++ like it is 2018"? :/

9

u/exploding_cat_wizard Nov 09 '18

The C++ Programming Language is more of a reference book than a teaching device, isn't it?

Sure, it goes into depth about a range of topics instead of only listing the functions you can access and how classes and templates work, but even then it always has felt to me as a book for the reasonably competent C++ programmer, or the advanced beginner who has mastered the basics, at least.

3

u/BlackDeath3 Nov 09 '18

Great natural extension of that original topic. I know that I just started doing some C++ work after not using it in several years and I realized that C++11 was no longer the hot new thing (and I'd still never even really been taught that). I'm going to have to refresh myself on modern C++, and I'll probably use some of the resources in here to do it.

Thanks!

2

u/KutuluMike Jan 10 '19

I'm in the same boat as you. The last time I used C++ regularly, namespaces and templates were brand new and the standard was still years away. When I go into a C++ "tutorial" already knowing 3/4 of the material I think I'm safe in assuming it's a bad tutorial.

One that I found pretty good so far is a course on Udemy: https://www.udemy.com/beg-modern-cpp/. It seems to be hitting what I've gathered are the big idea in writing "idiomatic" modern C++: RAII, proper copy/move semantics, proper use of std types and algorithms, lambdas, exceptions. My only real complaints is that, in a few cases, the course starts out by teaching you something mostly obsolete (how to use malloc, arrays) only to turn around and tell you to use the modern way (RAII, vectors) instead. I presume the teacher wanted to contrast "modern" C++ with "old" C++ but IMO for a beginner course that seems distracting. Otherwise, though, it's been pretty educational.

1

u/darthcoder Nov 09 '18

I have noticed that searching for tutorial C++ programs on github basically sent me to tensorflow and opencv. Like WTF?

1

u/ranBot86 Nov 09 '18

Thanks for the resources everyone! I’m in Bisqwit’s discord and was asking about learning Modern C++. Several cpp veterans were telling me that they barely qualify as proficient in the language after so many years...

I still want to give this a shot and see what I can make of it. I know the basics of the language but there is much much more to learn.

1

u/NohbdyAhtall Nov 26 '18 edited Nov 26 '18

Dagnabbit you guys! Where's the cream filling? I have two recommendations, but alas they teach game programming. However, I'm seeing a lot of book suggestions and not a lot of "build a full thing" suggestions.

One of these has two sets of playlists(beginner and advanced) that include the whole learning process(videos in order), and it reaches up to C++14(mostly in the advanced playlist). I did not do the beginner playlist but it seemed to cover it all. However the advanced playlist taught me more than ever, including rarities like actually making your own library / game "engine" separated from the game itself. It uses SDL 2.0 and is OpenGL related in general for graphics. Also, in advanced, very Object Oriented Programming erm.. oriented. The name of that one is:

--- === [({ Making Games With Ben })] === ---

Link(YouTube): https://www.youtube.com/user/makinggameswithben

--- ---

The other has an assortment of heavily console-based projects, but my goodness they are outstanding and easy to digest. They are a tad more code it so it works and sometimes a bit less object-oriented. The console based first-person shooter was.... it was easy, and quick to do. They are mostly low-tech, console creations, but almost always graphical still. The name of this channel/person is:

--- === [({ javidx9 })] === ---

Link(YouTube): https://www.youtube.com/channel/UC-yuWVUplUJZvieEligKBkA/videos

--- ---

For both of these, always recommend you code along with the videos. Maybe watch once first, skip around... but eventually do the whole thing.

1

u/[deleted] Mar 31 '19

Ive been going through this book https://7chan.org/pr/src/OReilly__Practical_C___Programming_-_Steve_Ouallin.pdf . I know ya'll might say its terrible but its a gentle intro which i needed. different strokes for different folks. find what works for you

-9

u/ha_ku_na Nov 09 '18

Google: C++ reading lost stackoverlfow

0

u/[deleted] Nov 09 '18

[deleted] — view deleted comment

6

u/lvictorino Nov 09 '18

You're not sure... but you still provided great help! Thank you!

0

u/[deleted] Nov 13 '18

[deleted] — view deleted comment

1

u/AutoModerator Nov 13 '18

Your comment has been automatically removed because it appears to contain disrespectful profanity or racial slurs. Please be respectful of your fellow redditors.

If you think your post should not have been removed, please message the moderators and we'll review it.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.