Advertisement

starting with c instead of c++

Started by June 03, 2002 07:58 PM
12 comments, last by pandabear114 22 years, 5 months ago
Hmmm, so, heres my problem. I want to eventually be writing games in c++ once I am done learning everything, but my dad had (he left) like 20 different c language books that would basically teach me anything I would ever want to know about it. I also have the etext for the ibm pc programmers guide to c (i think from this site). So my problem is that I want to eventually write in c++, but right now I have so many c resources, it seems like a waste to not use them (since i am new to the c language in general) C++ is supposed to just expand off of c and it changes some of the syntax, correct? so would it be ok if I just went ahead and learned a lot of c, and later on started c++? or would that not be a good plan? thanks in advance
in my opinion you should not start learning c before c++. Although a LOT of the syntax is the same, it will teach you "bad" habits in the long run (if your gonna be doin c++). Many people have a hard time transitioning from procedural programming to object oriented coding. C encourages procedural coding, so it does kind of hurt you when you move to c++.
~EODCyismARDEM
Advertisement
Well I think it would be easier to just learn C++ stright away but if you have the books you might as well use them, although some will say you can get into bad habits using C before moving on to C++ but hey!

CEO Plunder Studios
[email=esheppard@gmail.com]esheppard@gmail.com[/email]


If you learn C++ from scratch, then you will also be learning C. Everything you learn in C can be used in C++, but somethings in C++ cant be used in C.

Plus, most C++ books will either first teach you an abbreviated C or will expect you know C.
If you learn C before C++ just make sure to pick some up-to-date documentation on C++ and not rely on "C with classes" documentation. Several ''key'' features of the C++ library have evolved a lot since the arrival of classes.

In particular, remember that C++ standard headers do not have a .h extension.

Other than that, knowledge of the C library is always a good thing to have, even in this C++ world.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I see no harm starting with C, as long as you keep it in the back of your mind that you will make the transition to C++ eventually. I started with C, and I don''t think I picked up any bad habits from it. On the contrary, it serves to distinguish what C++ brings to the mix. I appreciate object-oriented features all that much more, having first lived without them.
Value of good ideas: 10 cents per dozen.Implementation of the good ideas: Priceless.Machines, Anarchy and Destruction - A 3D action sim with a hint of strategy
Advertisement
hmm
so far I have had 2 "yes, it is ok" replys, 2 "no, don''t do it" replys, and one sort of impartial

so now I am just even more confused than before :\
I''m still just starting to break the habit''s I got from C. Luckily since C-code works when using C++, it''s not too hard of a hit, and you can gradually slide yourself into the Object-Oriented craze.
I would personnally say: Go straight into C++

------------
aud.vze.com - The Audacious Engine <-- Newbie alert, look at your own risk. Can induce severe laughing fits and other variations of hysterical outburst.
_______________________________________Pixelante Game Studios - Fowl Language
I started with C, and I have no problem writing completely OO C++ code...

ok
since i am not really getting anywhere in my current situation ()
has anyone read c++ in 21 days, and do you think it is a pretty good book for teaching all hte c++ basics if i just went straight into c++ rather than c?

This topic is closed to new replies.

Advertisement