I disagree about 98%!michiguel wrote:I agree 100%.Zach Wegner wrote:I think C would be easier for a beginner to learn. No need to learn about namespaces, inheritance, operator overloading, polymorphism, etc. C++ has some nice features, but they won't really be useful until you know a lot about programming (and it would be bad to try and use them before then). It's a classic beginner's mistake to hear about the wonders of object oriented programming and then make every thing an object. This is inevitably slow. IMO you should learn C first and then decide if you want to learn C++.
Also, in my highly subjective opinion, C is a much more elegant language, since it matches in my mind what the CPU is doing. For every piece of code I write, I more or less know what the assembly is going to look like. When you see C++, you start have to dealing with function tables, templates, etc. It gets messy.
That's the 1970's!michiguel wrote: Sherif, I was in your same situation and I have a strong opinion on this ==> Buy the classic "The C programming language" by Kernighan and Ritchie and learn it. It is a short book and if you are a skillful learner, your will be programming in C in no time. Of course, you have to like programming.
If you want a new book about programming, aimed at beginners, try this:
http://www.research.att.com/~bs/programming.html
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.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).
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.
Of course, this is my not so humble opinion from a professional programmer.michiguel wrote: Of course, this is my very humble opinion from a non-professional programmer.
Miguel