It teaches C++ as a language in its own right. That's why you should not start with C, and then "upgrade". C++ really is a different language!michiguel wrote:Thanks, I may go to the library and see whether I can read something interesting and learn. I mean it. However, I wonder the suitability of this book for a beginner in this hobby. That type of beginner is not the same as a comp. sci. first year college student. Just peeking at the sample pages available in that website I see the typical examples of a display model, oriented to teach OOP. IMHO, that is exactly what a beginner should be avoiding. Paticularly, if the goal is to write later a chess engine.Bo Persson wrote: If you want a new book about programming, aimed at beginners, try this:
http://www.research.att.com/~bs/programming.html
I would agree that C++ will be better than C if there is a book that teaches it as an "improved C", with better type checking, libraries, and that's it. Is there any? I believe that most of the whistles and bells will be distracting for a hobbyst, at least at the beginning. That was my point.
If you already know how to program, you can learn C++ from "Accelerated C++", which also is C++ only - no C!
http://www.acceleratedcpp.com/
It teaches the use of the C++ standard library, containers, iterators, overloads, generic functions, and user defined classes, before going into the really difficult stuff like pointers and arrays.
Think about it!
No, so why do we say "learn C first", if you don't need it anyway? Cut to the chase, and learn the useful stuff first!michiguel wrote:michiguel wrote: For a chess engine you do not need C++. IMHO, for people like you or me, C++ is the worst decision possible. If you like to go higher level for other reasons, then learn Python. If you are going to make a living out of programming, maybe C++ is for you.
I think it is more important to buy a good book on data structures, than learn specifics of a complex language as C++. Keep the language simple, and go deep into structures and algorithms. Besides, I believe this is more fun.
When I started programming, I started with Turbo Pascal (~80's). Later, I learned the Object oriented features of new versions (early 90's). It was cool to learn, but implied an effort that was not needed. I just did it as a hobby.
Learn C first, and then you will realize that you will never need C++ You may like to learn it as a hobby, though (as I may like to do it some day).You don't need anything of that to write a chess engine. The only thing I use from above is malloc in a couple of places, and that is wrapped in another function.Bo Persson wrote: Learn C++ first, and you will realize that you will never need to learn the ugly and very dark corners of the C standard library, with functions like strcpy, malloc, memset, or others with easy to learn names like strpbrk, strxfrm, wcsncpy, and sscanf.
There are large parts of the C runtime that you hardly ever use in a C++ program. Why start out trying to learn that?
Very few C++ programmers find it easier to have functions like abs, labs, cabs, and fabs for the absolute value of different types, when std::abs works for all of them.
Miguel
There is a lot of C that is of very little use, once you have learned the better ways of C++. So start there!