Is learncpp.com good for beginners? [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
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?

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.

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.

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.

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

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

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.

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

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.

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!

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.

Related

What C++ tutorial would you recommend for an experienced programmer that has some patchy knowledge about the language? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
In my early days of programming, before I started working professionally, I wrote a fair share of trinket/exercise apps in C++ and felt fairly confident that I know the language. Then, as opportunity came, I went to do real work and left the C/C++ world. For the past 5 years I've written tons of code in C# and have had scarcely any encounters with the C/C++ languages. Now, after spending some time on SO and teh interwebs, I see that what I thought I know as "C++" is actually a mix between C and C++, with large gaps in my knowledge about the more intricate workings of the language. At the same time I also realize that I am intrigued by the language and would like to learn it more.
Googling for "C++ tutorials" reveals a wealth of tutorials, but they are all aimed at complete beginners, spending a lot of time explaining basics that I'm already familiar with. I don't expect that there will be any tutorials made exactly for me, but are there some that have at least been written with an experienced programmer in mind, not spending a lot of time on trivial things, and discussing the finer points of the language and compilers?
C++ is too complex to be learned through tutorials, you could only scratch the surface that way. Especially the advanced usage of the STL (and templates in general) is usually beyond the scope of online tutorials.
Therefore, I would recommend books: Stroustrup's "The C++ Programming Language", and Scott Meyer's "Effective C++", "More effective C++" and "Effective STL".
You can skip the first few chapters of Stroustrup if you feel confident you know that part already, but it's the best book for going into the details of the language. There should be a law for every aspiring C++ programmer to read at least the first two of Meyer's books I mentioned.
Once you're through with that, check out "Modern C++ Design" by Andrei Alexandrescu for a real eye-opener for what templates can be used for.
Update: In reaction to a downvote eight years later (...), be aware of The Definite C++ Books List. My personal recommendations above hold true, but that list is community-driven.
C++ is a very old language so there are lots of good books available. I would recommend to read those books, rather than searching sites and blogs. My personal experience says in harder to find lot of good articles at one place, by most of the good articles are already in books.
Regarding sites:
Dr. Dobb's site and journal have lots of good articles.
Books:
Effective C++
Exceptional C++
C++ Object Model
Bjarne Stroustrup
Beyond the C++ Standard Library
I suggest, though rather as supplement, the C++ FAQ Lite. It has information ranging from basic things to really obscure C++ features and many tips to write good C++ and helped me more than once when some stupid template thing or whatever wouldn't do what I expect.
1.C++ Object model is nice book for professionals.
2.Design and evolution of C++ by bjarne stroustrup give you in-depth insight.
3.Scott Meyers' Effective C++ series is also nice one.
You've gotten a number of good recommendations, but none seems to have included the one that was really written to fit your situation. Accelerated C++ was written for people who already know the basics of programming, and just want to learn how to program in C++.
Workings of the language? What areas exactly do you think are worth improving? I have a slight trouble extracting it from your question.
One book that i always keep on my table and peek into frequently is C++ Primer by Lippman et al, 4th ed., ISBN 0-201-72148-1. This is not a tutorial, this is a reference. Whenever you have a question about the language itself, this is where you can find a short and precise answer.
If you want specifically a tutorial which aims at experienced C programmers, see Bruce Eckel's Thinking in C++. Available as free download on author's site and also printed through Prentice Hall.
At some point you will have learnt a great many things which you CAN do, from then on, you should learn what NOT to do. This is a long and painful part, and i don't have a precise recipy, but accept my sympathies. The deeper you get involved into complex stuff the more likely is it to bite you at some point due to conflicts between language features. I suggest taking a look at Imperfect C++ by Matthew Wilson, C++ Coding Standards by Sutter and Alexandrescu.
You probably want to skip the stuff you already know and move on to harder more fun stuff. I assume you already know a lot about the language and it's syntax, methods, classes, etc.
Where to start? Well, there are very good books and papers on the language. I can recommend many books on the language but you can probably find them using the stackoverflow search.
I can only tell you what you already know. You wont find a book that covers it all. You will have to browse through many books in order to get what you desire. Take a randomly recommended book, browse through it skip the stuff you know and try to fit it all together. Try to make something out of the fresh knowledge by writing some code to understand it better. Do it until you understand it fully.
Here is a brief tutorial for advanced C programmers to refresh your memory on the language.
Essential C++ by Lippman is a small but great book.

Learn C++ to understand examples in book fast, know C and Java already [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I need to read "A Practical Introduction to Data Structures and Algorithm Analysis" by Shaffer for class but the code examples in the book are all in C++ which I do not know. I know C and Java already and was wondering if you knew any resources that helped learn enough C++ to understand these examples fast if you already know another language. Thanks!
Another free textbook is The C++ Annotations by Frank B. Brokken. You can browse it online, or you can download the pdf version.
A quote from the first page:
This document is intended for
knowledgeable users of C (or any other
language using a C-like grammar, like
Perl or Java) who would like to know
more about, or make the transition to,
C++. This document is the main
textbook for Frank's C++ programming
courses, which are yearly organized at
the University of Groningen
What I like about "The C++ Annotations" is that is being kept uptodate, version 8.0.0 has
added C++0x chapters.
Yes, (the first edition of) Thinking in C++ taught me how to read C++ syntax; it was designed for C programmers and each chapter built incrementally onto my existing knowledge of C, which I found helpful (and it's now available in print or as a download). Many people recommend it.
I'm not familiar with the book, but any good Algorithms and Data Structure book should be understandable to anyone with programming experience, weather they understand the language the examples are in or not.
Especially, in your case where you already know Java and C, I can't see that you will have any problems following the algorithms just because they are written in C++
This is quite a textbook (and quite expensive, so see if your library has it), but I would recommend the man's book itself, the C++ Programming Language linky. I used it to enhance, rather than create, my understanding of C++, but I used it in the form of a dictionary, and it seemed to work out well. It is written for people comfortable with programming, and you've gotten the pointers AND the OO stuff down, so it may mesh well.
For example... Chapter 2, a Tour of C++ (as I have it open in my lap now), talks about a large number of things, many of which compare themselves to the "C" way of doing things. The things are not new to a Java programmer, but different syntax, etc. Basically, if you want to learn about C++ iterators, look up the iterators chapter, etc.
I think you'll do ok without necessarily needing a book, but C++ has ridiculously tricky syntax, (try figuring out how to assign a constant field in an object instance using the constructor, for example) and I found the book to be quite illuminating. Thankfully, there's a pretty nifty index including operators, which is quite helpful.
Lastly, if you want to be a guru (which I certainly am not), there are discussions about everything from "Exception-Safe implementation techniques" (Appendix E.3) to philosophy of developing large software projects.
So I've given you quite the advertisement (I've never met the guy, honest), but I've found the book to be quite useful.
See the following previous questions for online C++ learning resources:
https://stackoverflow.com/questions/45175/resources-online-to-learn-c
https://stackoverflow.com/questions/909323/what-are-good-online-resources-or-tutorials-to-learn-c
I'd recommend taking a look through C++ Primer Plus (5th Edition). What you probably need to get your head around is the syntax for:
the type system
templates
operator overloading
The basic syntax of C++ is usually fairly easy to get a hold of, however, C++ is a complex multi-paradigm language, which requires some serious study to use it effectively.
C++ Primer Plus (5th Edition) http://ecx.images-amazon.com/images/I/41YAKQF6BML._SL160_.jpg
I'm surprised no one has yet mentioned Accelerated C++. It's not based as much on your existing knowledge of C (or Java), but it will teach you the language as it stands alone.
I found 'C++' by Till Jeske, 2002, ISBN 0-201-75879-2 very good. It is not a pet killer, only 1.25 thick, and quite well written - concise and to the point. I knew some C++ before but Jeske's book really helped me.

Resources to learn C++ itself, not the basics of programming? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm something of a new, reluctant convert to C++ from a Pascal, Ruby, and PHP background. I haven't worked with Pascal since a few months of torture with "Delphi Turbo;" since then I've practically been eating and sleeping Ruby and PHP. I'm already well acquainted with object oriented programming and many various subjects.
My main trouble is that I already know the rudiments of C/C++ programming, less the actual experience of working with C++. I worked with C for long enough to realize that even without macros, etc, I didn't want to work with it. (Some of the disgust was from maintaining a CGI application in C, when accustomed to Pascal's automatic string management.) I know just enough C++ to be dangerous to myself and anyone else unwitting enough to use my "code."
I'd really like to work up to a good enough understanding of C++ to use libraries like Crypto++ and Boost without major problems or in-depth knowledge of the language's intricacies. I just need to figure out how to work with C++ without killing myself (either with C++, or with the long-standing dislike that I'm already battling).
What are effective resources that will teach me C++ without assuming that I must be retaught all basic programming? I'd rather not relearn concepts that I already know, unless the paradigm in C++ is significantly different. I'm also learning on my own time, so don't recommend me a book complex enough to need a guru to explain to me, please! And I have an effective budget of $0 for learning C++, so please keep suggestions to quality online resources or books common enough that I could likely find them at the library.
Read Effective C++ by Scott Meyers - it's a good guide for getting past the basics of C++ and showing how to write and use "correct" C++ code
The C++ FAQ Lite is a great resource.
I highly recommend Stroustrup: The C++ Programming Language (Third Edition). As the author of C++ he is the authority on the language, and the book is useful as a reference as much as it is for learning the language. It's common enough that most good general purpose libraries will have a copy. He goes into quite some depth on all the features of C++, including explanations of why certain design decisions were made in the language. Personally, I think this is the best book around for programmers to learn C++.
Once you have a good grip on core C++, David Abrahams and Aleksey Gurtovoy's book, C++ Template Metaprogramming, goes into further depth and provides many examples of how C++'s template system allows you to perform complex compile-time programming, a highly valuable skill these days. This one is a little less common but you can probably find it at a university library.
I can give you a couple of keywords you might want to research in more detail:
RAII (Is pretty much the technique that ensures you don't have to worry about memory leaks. Very convenient)
Generic Programming (The STL in particular. Experiment with iterators and the standard library algorithms, and see just how powerful these abstractions are. They're a key part of what I like about C++)
Functors (Perhaps too simple on their own, but the way they can be used instead of function pointers with the algorithms mentioned above is interesting)
And just get familiar with templates, and "mild" forms of template metaprogramming. (Traits classes, for example, and (partial) specializations.
And just keep an eye on the C++ questions here on SO. A lot of interesting topics are regularly brought up.
But the best advice is probably to keep it completely separate from C. Forget everything you learned about how to use C. It either doesn't apply in C++, or leads to inferior code that is harder to read and maintain.
It's an interesting language in its own right, and has a number of unique features. Leverage those, and it can actually be fun to work with C++. Treat it as an overengineered Java, PHP or C, and it'll just make you want to throw up.
You need to write code. A lot of code in C++. There is no substitute. You also need to read good code.
I agree with the suggestion for Scott Meyers' books though. Those are pretty good.
Part of your learning will be the leap from procedural programming to OO.
I would highly recommend the book "C++ Common Knowledge" by Stephen C. Dewhurst. Don't know if it's common enough to be found at the library (it's not at mine, but my library sucks for computer books that aren't 5-10 years out of date), but it does an excellent job of taking the complex aspects of C++ and making them easy to understand, without dumbing anything down for beginners. Definitely worth the investment.
To quote from the back of the book:
This book is for you if
You're no "dummy," and you need to get quickly up to speed in intermediate to advanced C++
You've had some experience in C++ programming, but reading intermediate and advanced C++ books is slow-going
You've had an introductory C++ course, but you've found that you still can't follow your colleagues when they're describing their C++ designs and code
You're an experienced C or Java programmer, but you don't yet have the experience to develop nuanced C++ code and designs
You're a C++ expert, and you're looking for an alternative to answering the same questions from your less-experienced colleagues over and over again
C++ Common Knowledge covers essential
but commonly misunderstood topics in
C++ programming and design while
filtering out needless complexity in
the discussion of each topic. What
remains is a clear distillation of the
essentials required for production C++
programming, presented in the author's
trademark incisive, engaging style.
Here is a link to a question with answers that should help you.
https://stackoverflow.com/questions/1227764/i-need-to-improve-my-c-skills-fast-is-this-realistically-possible/1227805#1227805
For effective stuff you can find online Cplusplus.com has a pretty good reference and information.
If you can find the book "C++ Common Knowledge" (Stephen Dewhurst) at the library or cheaply online, I would add that to the list posted on the StackOverflow link above as well as "The C++ Programming Language" (Stroustrup). Going through the questions under the C++ tag right here on SO should give you some good pointers and code examples to get you on your way.
Here's a list of good C++ books which teach you C++ rather than basics of programming.
Sit down and write some C++ code.

Well written C++ examples [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm currently learning C++ and would like to start reading others sourcecode to pick up tips. I was wondering if anyone has examples of well written C++ that I can take a look at (and not pick up bad habits from)
As you've probably discovered, there are many Internet sources for examples of C++ code. StackOverflow, CodeProject, etc. all have examples of source. But of course, they're all over the map in terms of quality and educational value.
I think, in this area, books still trump the Internet. There's no substitute for going to the bookstore, thumbing through a few tomes, and picking one that you find readable. They've been proof-read (unlike may Internet submissions), so the samples are more likely to work and to be of high-quality.
While the books typically have small snippets of code or a few functions, they usually come with a CD or URL that points you to more full-blown examples.
O'Reilly, Thinking in C++, Petzold, and Wrox (and more) all have good books on C++.
The Boost library? It is generally considered some of the highest quality C++ code written. (A lot of it is also more or less unreadable unless you're a C++ guru yourself, though)
In general, I'd advise against you to be cautious with this approach though. In C++, the source code probably won't be as informative as in many other languages.
If you see some Python code, you can pretty much assume it's correct as long as it runs. If it's written by someone who seems to know what they're doing, you can even assume that it's well written.
In C++, there are just so many nasty pitfalls and subtle exceptions to every rule that you really need to know what you're doing. Going by what compiles, or what seems to work, or what you saw in someone else's source code is dangerous, and pretty much guarantees that you'll sooner or later end up with a program that relies on undefined behavior, and will crash when you least expect it.
If I were you, I'd try to stick to books. There are some very well written ones, which in addition to letting you see some source code, also teach you the langage "properly". And as long as you stick to reputable authors, you're ensured that they won't teach you any bad habits or plunge you into nonportable code.
In my opinion if you read a good C++ book (like "The C++ Programming Language", "(More) Effective C++" or "Exceptional C++").
You will not only learn good practices but should also get sense of how to write code.
Of course the samples in these Books are mostly artifical. If you read 'real-world-applications' you will always encounter pieces of code which are pretty ugly, but sometimes there wasn't just a nice clean solution for it (or a not-so-clean solution was just more efficient in terms of speed).
So I don't know if it's best to start with real applications since they can also be very overwhelming due to the amount of codesize and complexity, whereas sample codes in Books are compact and clearly laid-out.
I think for starters you would be best off reading such references as the books I have listed.
If you have to be flexible at some point in the future and have to produce ugly code, you will at least know that it's ugly code and not mistake it for "that's how it should be" ;)
Reading through open source software can be very educational if you already have a little bit of knowledge of C++. If you're just starting out, I imagine the Boost libraries will go right over your head. You could start with the WebKit project, which is an excellent resource. Also Google releases a lot of their source code, which also happens to be VERY clean: Protocol Buffers is a great example. And while you're at it, you may as well read their C++ Style Guide as well.
Personally, I started learning C++ by picking up a couple of books and writing some little challenge applications. Bear in mind that learning a language as extensive as C++ takes a long time, like 10 years long.
Many years ago, I was told that if I ever wanted a career as a C++ developer, I should definitely read Effective C++ by Scott Meyers. That should prevent you from falling into many of the language's pitfalls. If you find you need something even simpler, start with The C Programming Language by Kernighan & Ritchie. Be patient and good luck!
If you want a complete project to browse through, I would recommend Ogre3d. It is a well structured graphics engine with decent documentation and the source code itself is nice, too.
How about: Programming: Principles and Practice Using C++ by Bjarne Stroustrup?

Get back to basics. How do I get back into C++? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I haven't used C++ since college. Even though I've wanted to I haven't needed to do any until I started wanting to write plugins for Launchy.
Is there a good book to read to get back into it?
My experience since college is mainly C# and recently ruby. I bought some book for C# developers and it ended up being on how to write C++ with CLI. While a good book it wasn't quite what I was looking for.
My favorites are Effective C++, More Effective C++, and Effective STL by Scott Meyers. Also C++ Coding Standards by Sutter and Alexandrescu.
The best way to get back into C++ is to jump in. You can't learn a real language without spending any serious time in a country where they speak it. I wouldn't try to learn a programming language without spending time coding in it either.
I wouldn't recommend learning C first though. That's a good way to pick up some bad habits in C++.
I haven't tried it myself but have heard from people and sources I trust that "Accelerated C++" by Koenig and Moo is a good book for people who want to pick up C++ quickly. Compared to the more traditional route of learning C first then C++ as a kind of C with classes the K+M approach helps you become productive quickly while avoiding pitfalls and bad habits associated with the legacy of the language.
A good starting place is "Thinking in C++" by Bruce Eckel, I've rarely had anyone complain about the book. Well written and also has a version available online.
Another online book that I pick up whenever I need to get back into C++ is "C++ In Action" by Bartosz Milewski. Its online at his site.
The C++ Programming Language by Bjarne Stroustrup covers C++ in depth. Bjarne is the inventor of C++. It also provides insights into why the language is the way it is. Some people find the book a little terse. I found it to be an enjoyable read. If you have done some C++ before it's a great place to start. It is by no means a beginners book on C++.
My book recommendations:
Essential C++ (Lippman)
C++ Common Knowledge: Essential Intermediate Programming (Dewhurst)
...and I second the Effective C++ suggestion above.
A very handy alternative to buying books in meatspace is to subscribe to a service like Safari Books Online. For a not unreasonable monthly fee you'll get access to all of the above books plus a bajillion others. If you desire fast random access to more than a couple books, it pretty much pays for itself. It's an easy case to make if you want to convince your employer to pay for it.
Beyond that, sit yourself in front of an IDE that has a C++ code completion feature (I use Eclipse/CDT most of the time).