I have a friend who wants to learn C++, but does not want to pay. I found Cplusplus tutorial, but I was wondering if there was any other material available for free.
I've had a look at Thinking In C++, but I feel it may be a bit advanced (totally new person).
Thanks.
views:
302answers:
11Google is the worlds #1 free educator. Google anything similar to "C++ tutorial", "C++ walkthrough", "learn C++", etc, and you'll find more than enough.
Check out Bruce Eckel's freely-available book Thinking in C++. It's not perfect, but it's a nice complement to other free C++ resources.
C++ is a very hard language as a first language. Do they know C -- I would definitely start there, and if so, with this:
If he/she is being introduced to the concept of programming for the first time, then I would really recommend Stroutrup's Programming -- Principles and Practice Using C++.
From author :
This book is for someone who has never programmed before but is willing
to work hard to learn. It helps you understand the principles and acquire the
practical skills of programming using the C++ programming language. My aim
is for you to gain sufficient knowledge and experience to perform simple useful
programming tasks using the best up-to-date techniques. How long will that
take? As part of a first-year university course, you can work through this book in
a semester (assuming that you have a workload of four courses of average difficulty).
If you work by yourself, don’t expect to spend less time than that (maybe
15 hours a week for 14 weeks)
EDIT:
This book is not free, but the book impressed me as it teaches not only programming but also good practices and principles that it claims (you can go to nearest library or ask around to see if anyone has it)
If this person is totally new to programming, I wouldn't start them off with C++ for one simple reason - you have to be exposed to all sorts of concepts (some advanced, others not as much) just to write the most basic program.
Consider the most basic "Hello World" program in both Python and C++:
Python:
print "Hello World!"
That's all there is - you tell the computer to print, and it does. Most people are used to writing commands or doing things similar to this every day.
C++:
#include <iostream>
using namespace std;
int main(){
cout << "Hello World!" << endl;
return 0;
}
Here are the things you're exposed to (you don't have to understand them, sure, but you're still faced with either accepting, ignoring, or fleeing in terror):
- Header files/inclusions.
- Namespaces
- Functions
- Operator overloading (you just don't know it yet)
- Return codes
And we haven't even begun to look at any of the real programming features like loops and branches.
That being said, I do enjoy C++ on occasion, but a link to this reference is a requisite.
There is "free" and there is "free".
First of all, like many programming languages, you can find free C++ compilers and linkers which means you can write programs for free. I recommend writing as much as possible, there is nothing like practice.
Second, there are free resources available, but if it's easy to find documentation or reference (on the STL for example), I have found online tutorials lacking (some are far from comprehensive, other teach bad habits).
Often times people also talk of looking at free C++ software and page through the code: honestly it's hard... The good ones are coded for portability, with a lot of hacks for particular compilers that just clutter the code. And it's hard to know in advance if a particular library is good or not: its usefuleness or the fact it's widespread does not tell much about the quality of its design, and some are very performance-oriented with dirty hacks thrown in to get that extra kick: not something to be concerned about for beginners.
I do recommend taking a look at the Guru of the Week site, there are articles there that later went into Sutter's Exceptional C++ book ;)
Third, there are resources that are nearly free: you can always borrow a book from a friend or from a library, or get second-hand books at low rates. I do have the chance to work in a computer shop, which grants me access to its library, and its collection of programming books, for free, and I certainly used this as much I could. The caveat being that some books are a bit too advanced sometimes: mark them down until you feel ready to come back to them.
Finally, I personally recommend buying a few references book nonetheless. Perhaps not to begin with, but as soon as you'll get serious about programming in C++ you'll probably need a copy of "The C++ Programming Language". One cannot live on borrowed books forever.
I used LearnCpp.com.
It may not cover everything, but it's definitely useful, if only for reference on the syntax.