Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#Actualrnlf

Posted 11 July 2012 - 05:20 AM

I don't think it is a good idea to learn C before learning C++ for several reasons:
  • Modern high level C++ has very little to do with C (you usually try to avoid pure pointers wherever possible, you don't do explicit memory management, you don't use C style I/O, preprocessor constants etc)
  • You're most likely not risking adopting a bastardized C/C++ mixture, it is almost impossible to avoid it, because as a beginner, you do not have the experience to discriminate between what you need for C++ and what you don't.
  • In C, simple programs are much harder to get right than they are in C++, because beyond "Hello World", you need to work with pointers or pointers in disguise (arrays), manual memory management, the syntax is much more restrictive in a lot of ways and so on...
If you *really* want to learn C++ as your first language, try to avoid the C parts of it as long as possible. It may be hard to understand the STL in the very beginning because template instantiation may take a while to get behind, but it will free you from all the nightmares, beginning C programmers used to have.

Don't get me wrong though, I am a huge C geek myself, but it took me years to let go of old C practices when I switched to C++ and even today as a professional software engineer, I sometimes have to force my self to do things in a clean way instead of the quick C hack way.

Oh, and if you can, try to find a book that covers C++11. I don't know whether there are any beginner books on this topic available yet, but with C++11, it becomes much more accessible to beginners.

But in the end, I typically advise people not to begin programming with C++ before they know some important concepts. It is possible, but it is also quite frustrating from time to time. You better start out with an easier language like python (or even this horrible C# thingy Posted Image)

#2rnlf

Posted 11 July 2012 - 05:18 AM

I don't think it is a good idea to learn C before learning C++ for several reasons:
  • Modern high level C++ has very little to do with C (you usually try to avoid pure pointers wherever possible, you don't do explicit memory management, you don't use C style I/O, preprocessor constants etc)
  • You're most likely not risking adopting a bastardized C/C++ mixture, it is almost impossible to avoid it, because as a beginner, you do not have the experience to discriminate between what you need for C++ and what you don't.
  • In C, simple programs are much harder to get right than they are in C++, because beyond "Hello World", you need to work with pointers or pointers in disguise (arrays), manual memory management, the syntax is much more restrictive in a lot of ways and so on...
If you *really* want to learn C++ as your first language, try to avoid the C parts of it as long as possible. It may be hard to understand the STL in the very beginning because template instantiation may take a while to get behind, but it will free you from all the nightmares, beginning C programmers used to have.

Don't get me wrong though, I am a huge C geek myself, but it took me years to let go of old C practices when I switched to C++ and even today as a professional software engineer, I sometimes have to force my self to do things in a clean way instead of the quick C hack way.

Oh, and if you can, try to find a book that covers C++11. I don't know whether there are eny beginner books in this topic available yet, but with C++11, it becomes much more accessible to beginners.

But in the end, I typically advise people not to begin programming with C++ before they know some important concepts. It is possible, but it is also quite frustrating from time to time. You better start out with an easier language like python (or even this horrible C# thingy Posted Image)

#1rnlf

Posted 11 July 2012 - 05:17 AM

I don't think it is a good idea to learn C before learning C++ for several reasons:
  • Modern high level C++ has very little to do with C (you usually try to avoid pure pointers wherever possible, you don't do explicit memory management, you don't use C style I/O, preprocessor constants)
  • You're most likely not risking adopting a bastardized C/C++ mixture, it is almost impossible to avoid it, because as a beginner, you do not have the experience to discriminate between what you need for C++ and what you don't.
  • In C, simple programs are much harder to get right than they are in C++, because beyond "Hello World", you need to work with pointers or pointers in disguise (arrays), manual memory management, the syntax is much more restrictive in a lot of ways
If you *really* want to learn C++ as your first language, try to avoid the C parts of it as long as possible. It may be hard to understand the STL in the very beginning because template instantiation may take a while to get behind, but it will free you from all the nightmares, beginning C programmers used to have.

Don't get me wrong though, I am a huge C geek myself, but it took me years to let go of old C practices when I switched to C++ and even today as a professional software engineer, I sometimes have to force my self to do things in a clean way instead of the quick C hack way.

Oh, and if you can, try to find a book that covers C++11. I don't know whether there are eny beginner books in this topic available yet, but with C++11, it becomes much more accessible to beginners.

But in the end, I typically advise people not to begin programming with C++ before they know some important concepts. It is possible, but it is also quite frustrating from time to time. You better start out with an easier language like python (or even this horrible C# thingy Posted Image)

PARTNERS