14

In my search for a good, freely available resource that will teach me C++ I stumbled on http://www.learncpp.com/.

My question is for intermediate to experienced C++ programmers...

Does this site seem to be a good resource for a beginner to learn C++ from?

I've gone through the first few section of the site, and I feel like I am starting to grasp the language, but being a beginner in C++ I really could be learning things all wrong and have no idea.

EDIT: After doing some research on this topic, and reading the answers and comments here, it seems like if I do the tutorial, read Accelerated C++, and then read Effective STL... I'll be on the right track. Of course, I'll be writing programs to solve project Euler programs and such. Do any of you have a better idea for a beginner with intentions to become competent in the language?

Dream Lane
  • 1,282
  • 5
  • 16
  • 27
  • If you feel like you're starting to learn, then the site is probably working! :) ...seriously, I *did* just skim some of their pages just now. I'm very rusty on C++ but it looks well-written. I'm more of a visual learner and prefer diagrams to code listings (when possible), but it looks like a good site. I expect you will learn something good from this site. – FrustratedWithFormsDesigner May 26 '10 at 18:10
  • 1
    Lots of people feel like they're starting to learn when they use resources that teach horrible practices that aren't immediately obvious as horrible. Take W3School's PHP SQL tutorial, I haven't found an example that takes user input without demonstrating an SQL injection hole yet. – Quentin May 26 '10 at 18:13
  • This tutorial is the most voted tutorial on this C++ tutorials' collection: https://hackr.io/tutorials/learn-c-plus-plus. If you are interested in other formats of C++ courses/tutorials (like course based, video based, book format, etc) then you'll see suggestions for other tutorials as well on the above-mentioned page. – Saurabh Hooda Aug 04 '17 at 16:09

10 Answers10

12

The site does not look too bad.

However it really is a tutorial, in that it just explains the very basic concepts of C++.

Notably, it completely misses an introduction to the STL and the proper use of it. You barely see std::cout and std::string. There's no mention of <algorithm> that I could see of and no mention of the <vector> or <deque> or <map> which are the most commonly used containers in C++.

It may not hurt you to learn with this site, but you'll only have a very basic level when you're done with it.

Matthieu M.
  • 287,565
  • 48
  • 449
  • 722
  • I accepted this answer because I feel like it concisely and informatively answers my question. Thanks! I guess this means I will finish up the tutorial, and then go for a book for more advanced (but still beginner) topics. – Dream Lane May 27 '10 at 11:57
  • You could try 'Effective STL' by Scott Meyers for STL specifics point. If you're not ready to buy it, you could perhaps ask friends around about what they have in their libraries :) – Matthieu M. May 27 '10 at 14:09
  • 1
    @Matthieu - I would say that this book would be over the head of a beginner who hasn't been introduced to the STL already. A better book to read after or in place of this tutorial would be Accelerated C++ by Koenig and Moo. Then the Meyers and Sutter books will be easier to understand and follow. – Edward Strange May 27 '10 at 16:02
  • Thanks, I've only delved in the books after some hand-first experience so I wasn't really a beginner (though I certainly lacked some theoretical background). – Matthieu M. May 27 '10 at 16:17
  • Is *really* one of the most commonly used containers? – Eric Sep 15 '10 at 06:40
  • @Eric: Well, in the code I am working with it is, though not as much as ``. I particularly appreciate its iterators invalidation conditions and I am (a bit) lobbying my coworkers :) – Matthieu M. Sep 15 '10 at 07:21
  • As of today (October 23, 2017), the website contains an introduction to the STL, std::string, iostream, etc. – Muntashir Akon Oct 23 '17 at 01:36
11

If you want to learn C++ the right way I strongly recommend you purchase a copy of Accelerated C++. It is the best C++ book for a beginner without a doubt.

CMircea
  • 3,543
  • 2
  • 36
  • 58
7

Although the few pages I looked at seem reasonable, any instruction on C++ that recommends the use of Hungarian Notation completely misses the point and is thus suspect.

Edward Strange
  • 40,307
  • 7
  • 73
  • 125
  • I'd like to hear more about this. Could you provide some links, or some further explanation about why Hungarian Notation should not be used? – Dream Lane May 26 '10 at 18:48
  • 6
    An article - http://www.joelonsoftware.com/articles/Wrong.html – Secko May 26 '10 at 19:15
  • 1
    Actually, the article you just linked is an apology of Hungarian Notation (the original one). It just scolds programmers for using a perverted version of it because they completely missed the point :/ – Matthieu M. May 27 '10 at 06:32
  • 3
    @Dream Lane - Because a variable should be named after its use, not after its type. The type can change, especially in C++, and as long as the new type retains the used interface of the old type clients shouldn't care. This really begs the question why they care in the first place. As to the article linked by Secko, this is better, but naming conventions are not adequate to the needs expressed in that article. The author should be using the type system to protect themselves and future developers from misuse, not a naming convention that can be misunderstood. – Edward Strange May 27 '10 at 16:00
  • Really, a naming convention should, IMO, be as simple as, "use names that make sense and represent the purpose of the item named." Unfortunately we really did have to *specify* this in our coding convention because someone was a major fan of Master and Commander and kept naming things after boats. It should really just be common sense though. – Edward Strange May 27 '10 at 16:06
  • The use of Hungarian notation in C++ has long been controversial, so anyone who gives a glib answer entirely pro or con is highly suspect. As the Joel article points out, there are two major variants of the notation, so arguments about just one necessarily miss the point about the other. For the record, my view is that (applications) Hungarian has its uses, but also certain problems. – Steven Sudit Jun 01 '10 at 16:00
6

This site doesn't look too bad, but I don't think it's great either. A great free resource to learn C++ is the book "Thinking in C++". It's simply outstanding and I heartily recommend it to you. The other thing I recommend you is to start writing some code in C++ right now! Project Euler is my favourite source for beginners programming tasks(especially if you like math ;-) )

Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
  • I've just started using Project Euler, and it seems to be a great platform for me to test out the new concepts I learn in C++. Good tip thanks! – Dream Lane May 26 '10 at 19:03
5

When I was in the university I was using the http://cplusplus.com/. I was quite satisfied with everything there.

sovanesyan
  • 1,098
  • 1
  • 8
  • 15
5

It doesn't hurt to start of learning a language through a tutorial, but keep in mind that a tutorial may not (will not) cover all topics of a language. There are always better things than tutorials, like a book and a compiler.

I would recommend that you base your study on a good book like The C++ Programming Language (Third Edition and Special Edition) by the creator of C++ Bjarne Stroustrup.

It doesn't necessary have to be this book, it can be any useful book that other programmers have used and learned from. Books are also programmers tools.

Community
  • 1
  • 1
Secko
  • 7,664
  • 5
  • 31
  • 37
  • I argue against a book here, since I always had to do something with a programming language to actually learn it. Reading a book didn't help much.. – Nils May 26 '10 at 18:53
  • 7
    @Nils A book broadens your view of the language in general, it also explains some concepts you may have skipped. – Secko May 26 '10 at 19:11
  • It's good to read this book, but I wouldn't recommend it as a starting point. – Steven Sudit Jun 01 '10 at 16:01
4

I'm currently reading the C++ tutorial at learncpp.com and think it's great!

For a C++ beginner, like me, that is. You won't get all the answers, but do you really want that as a C++ beginner? I would say no. At least, I don't.

What you will get are lot's of short answers to questions about basic C++ concepts, that I believe will be helpful when you later learn about other aspects of C++.

As I said, I'm a C++ beginner, but I have used PHP for several years. I would't say I'm a PHP expert, but I'm not a beginner either, so I think I more or less know what I'm talking about when it comes to languages resembling PHP, like C++.

matsolof
  • 2,665
  • 3
  • 18
  • 17
  • 1
    From a short look it seems to be Ok, but there is one thing which IMO makes it not the best resource for beginners. They introduce arrays and C-style strings in chapter 6, while they totaly skip STL containers and leave std::string for chapter 17. Which leaves the wrong impression. C-style strings and naked arrays should rarely be used at all, and certainly not by beginners. – Fabio Fracassi Sep 15 '10 at 09:02
  • 1
    When I know more C++, I most likely will agree with the comment above. But, as I said above, the reason I think learncpp.com is good for beginners is that you get short answers to questions about basic C++ concepts, that is comprehensible to a C++ beginner like me. I haven't found any other site written in the same style. Most tutorials rather remind of the comment above. I other words, in many cases terms like "arrays", "C-style strings", "STL containers", "std::string" and "naked arrays" isn't explained in a way that a beginner can understand. – matsolof Sep 16 '10 at 11:31
  • What I also can't find in the comment above is a link to a site with a tutorial that the author think is better than learncpp.com AND that is written in the same style as learncpp.com. Post such a link, please, and help me agree with you! – matsolof Sep 16 '10 at 11:33
3

Yes.

The tutorials have a comment section, and the admin seems to be responsive to questions there. This indicates that there is some accountability for the material in the lessons.

John
  • 15,990
  • 10
  • 70
  • 110
2

I have been using C# for several years... Sometimes I have to work with legacy C++ code (some dated back to VC6, written 10 years ago), but I didn't understand the basic of C++ quite well, for example, how the header files work, and why c++ compiler requires the forward declarations,as well as the extern keyword. So I decided to find an online tutorial to learn some basics of C++, and this is what i found, learnCPP.com!

The tutorial is very well-written, in plain, comprehensible English, I hardly have to turn to the dictionary:-) (I am not an English speaker). Now I have been learning on this site for a couple of months, and I have to say everything I need to know to START programming in C++ can be found in this tutorial.

Admittedly this tutorial is not "an encyclopedia for the basic of C++", it does not include a dedicated chapter on unicode, or another chapter on the crt... but this tutorial is not meant to cover these topics, otherwise there will be much much more chapters in this tutorial.

Try and enjoy!

kennyzx
  • 12,845
  • 6
  • 39
  • 83
0

Learning by doing was the only thing which helped me to understand it. For example, if you want to learn templates and operator overloading, writing your own vector class which uses templates for the datatype of the elements and the length and operator overloading for all the operations as well as assignment will be an lengthy exercise which requires quite some nerves at first ;) But you will realize that you learnt how C++ actually works.

While I advice to write some small stuff as the example illustrated above, following the tutorial to learn the syntax and a the very basics probably isn't bad for a start.

Nils
  • 13,319
  • 19
  • 86
  • 108
  • Just came in my mind: Are you familiar with C? I would suggest learning C first or use C++ without all the OOP features first. – Nils May 26 '10 at 18:55
  • 2
    You can edit your post instead of placing a comment ;) – samoz May 26 '10 at 19:30