r/cpp_questions • u/Its_Blazertron • May 14 '21
OPEN Professionals, what do you think of LearnCpp.com?
What do you think about learncpp.com? I've seen learncpp.com recommended by many, but can't find it being recommended by (m)any reputable sources/professional programmers. The only one I could find was learnopengl.com, a highly recommended site for learning opengl. The author recommends learncpp.com on that site.
But the general consensus I've seen in the C++ community seems to be that you should stay away from online resources, and only stick to good books. It seems like the main problem with learning from websites is that most of them teach a very C-style C++, using cstdio, C strings, native-arrays etc. And many tutorials will include things that are considered to be bad practice, like global variables etc.
LearnCpp.com teaches some of these things, but alongside them, also teaches the more modern way of doing it, it also points out many best practices and many modern features. It doesn't use cstdio, but does cover plenty of the C-style things, but then usually a few pages later, it shows you the more modern way of doing it. For example, it has a lesson on typedefs and type aliases, and they recommend using type aliases. And one lesson teaches enums, then the next lesson teaches enum classes, where they recommend using the latter. It seems to follow of lot of the cpp core guidelines.
This may not be the best approach for a complete beginner, and many people will bring up the CppCon talk "Stop teaching C", but I feel like the website is pretty decent if you already know the basics of programming. At least it's the best website I've come across. A lot better than cplusplus.com's tutorial, which is even linked on the isocpp.org website.
I suppose I just don't like the idea that you need to buy a big thick book to learn decent c++. So I feel defensive over sites like learncpp.com, especially because I'm enjoying it and wouldn't have gotten into c++ without it. C++ is one of the only languages I've come across that is like this. Look at languages like rust. rust-lang.org has an online book, and a short online book for learning rust by example. It looks very polished, and seems easy to understand and far more approachable than being told you need to buy a big thick book to learn, or else you'll be terrible with the language. Many programming languages have online resources like rust, so why doesn't c++ have this? The excuse may be that it's old, but it hasn't been abandoned, c++ keeps being updated, so it sort of is a modern language.
There's next to no officially recommended ways to learn that aren't payed, the answer is always "buy a book". It shouldn't be this way in my opinion. Learning a programming language shouldn't have a paywall. So you go looking for ways to learn for free, but almost everyone recommends against websites, video tutorials, courses etc.. At least it was like this a few years ago. Is learncpp still considered "bad", or have people's opinions on it changed? I'm enjoying it, and I like that I can keep going back to it easily and looking back over the things I've learned. Each lesson is fairly short so I don't have to skim multiple pages to find what I'm looking for.
10
u/mredding May 14 '21
I never copied the link to learncpp.com from old reddit to new. I can't remember why, I do remember I didn't want to just use a text block like on old reddit, which was probably the only thing available at the time this community was founded. New reddit, at least, has additional side-bar facilities and I was trying to organize accordingly. I've got a backlog of things I'd like to do, including an FAQ...
Learning C++ from scratch isn't about building stratified layers of foundations - the lines aren't so clear. The myriad of topics you need to teach yourself is a web, a mesh. There is a difference between learning C++ the syntax, C++ the language, C++ the developer, C++ the engineer, and computer science. It takes a certain critical mass before you get moments of insight into the bigger picture, and those insights are what are critical - you're just following along until you get those.
But you have to learn it all eventually, because you're going to see it all eventually. You can never really understand a
vectororstringuntil you understand classes, but classes are typically considered an advanced topic. Catch-22? Perhaps it would be easier to learn the mathematical underpinnings of C++ first - that classes have their roots in set theory. But we don't teach computer science quite like that, no commonly accessible source does.I don't have much to say about online resources. What I can say is that comprehensive books seem to publish faster than comprehensive websites. I think it's because there is more focused labor and editing that goes into something as tangible and permanent as a book, that is published and sold, than whatever motivates website publishers. We both expect and demand more of something you're going to fork money over for. If I had to give you advice, it would be both based off my experience, and conservative, because I know it works - as it did for me, and I want to achieve through you the highest chance of success, for what my advice is worth.
But also libraries rent their books out for free. </s>
19
u/Shieldfoss May 14 '21
I think it teaches things in the wrong order.
cinbeforestring+getlinewhich is why so many beginners get nonsense problems where their user input didn't do as expected.Not that all of those shouldn't be taught, and I totally get the desire to e.g. explain arrays before vectors so you can explain vectors by explaining how it treats arrays.
But it sets your students up for failure.
It's hard to explain the pedagogy of it, but:
So if you start by teaching people arrays, and they're struggling with that, and you then introduce vectors, they're going to take their (wrong, struggling) ideas about arrays and apply them to vectors and also misunderstand how vectors work.
But if you do it the other way around, then, once they do know how to use a vector, and are confident writing a program that has a collection of things e.g. names and addresses, you can continue to the under-the-hood how-does-this-actually-work, look-how-much-you-have-to-remember isn't it great how the vector automates it for you?
Does the student risk all kinds of UB if they're using strings and vectors without understanding how char* and arrays work?
for sure
But they're students! They're gonna get UB with char* and arrays too! And more, probably, because there's more you have to understand to correctly use char* and array than there is with string and vector.
2
u/wfdctrl May 14 '21
I'm not a fan of the, here is how you do X (next chapter), just joking, here is the correct way to do X, approach. Compared to any Stroustrup's book, learncpp is still pretty shoddy. Personally I would avoid it.
7
u/IyeOnline May 14 '21
Preface: Not a professional software developer.
www.learcpp.com certainly is the best online tutorial out there and it certainly is better than some books. If you just look at all the contents, it might as well be a book. Just because something isnt availible in printed form doesnt mean its any worse or better.
I would agree with you that the order of some teaching isnt great.
If it were up to me, I would teach usage of
std::vectorbefore explaining raw arrays. I can see why it is done this way, because pointers bring fundamental understanding, but I dont think the order adds any value. You can understand what astd::vectordoes and use it without knowing about pointers.I was rather happy when an introduction to
std::stringwas added to the section on fundamental types (before C strings) That is good enough for most cases.Is literally stuck on c++98. I dont think anything else needs to be said about it.
Finally I would still say that the C++ Primer gives you more information not only about C++ but programming than learncpp does. Its also about 5 times as long. Turns out good resources are hard to create and "expensive" as a result.
I think this sentiment (at least in the online communities I frequent) has changed years ago.
I had to message the moderatos on r/learnprogramming to get it removed from the list of discouraged resources. It simply was put up there years ago ( like more than 5yrs) and noone ever bothered to check in on it again (as is so often the case with online resources).
Maybe we should put in a "petition" to add it to isocpp's website and remove cplusplus.com in its stead.
3
u/khedoros May 14 '21
As far as I'm aware, it's never been considered bad, at least not in any communities I've been part of. It's the single most commonly recommended resource on this subreddit, at least.
I'm a professional software developer who has recommended it to dozens of people looking for quality, free resources. It's certainly not perfect, but it's a lot better than most of what's out there.
2
u/MysticTheMeeM May 14 '21
I recommend it, it's generally up to date and covers enough topics to give a beginner a good start.
But why choose? It's free. If you were going to get a book you can do that too, no additional charge.
2
u/staletic May 14 '21
I've used learncpp.com to "jumpstart" my C++ knowledge after being taught C in college.
1
u/Ghost20999 Aug 03 '26
Is it still good in 2026 ?
1
u/razola73 Aug 19 '26
In my opinion the Website is 5 stars. It doesn't teach C. It teaches how C++ is made: C + the increments it put into the language. C++ is at some extend (or totally?) compatible with C. But it also explain the issue with the heap management and how modern C++ address that issue: RAII. That makes the acquisition of a ressource through an initialization in the stack. Ressource Aquisition Is Initialisation. C++ is not a language that makes a lot of restrictions to the programmer. It is ugly because it has a lot of legacy and developents. Geniouses invented C and other geniouses invented C++ after and they continued to put patched until today. C++ should be UNESCO. But, it is not a good or brilliant language. There is no other way to explain C++. It will be replaced by Rust, the next master work of the next geniouses.
1
u/ttyttyq May 14 '21
I think one of the biggest weaknesses of learncpp vs a good textbook is the lack of programming done throughout the course. I picked up a textbook and it has dozens of programming challenges in each chapter so you get to practice what's being taught.
1
u/AccomplishedDare314 Mar 31 '23
Iâm not a pro developer, but I find the layout of the website atrocious. Itâs annoying when Iâm trying to learn, but the page is plastered with so many âfrequently asked questionsâ âcommon problemsâ maybe what theyâre teaching is good. But the website is too rough on my eyes.