C or C++ I have lost my mind.

Started by
26 comments, last by LostSoul 24 years, 2 months ago
alot to say
first of all, c++ is more readable and easier to think in
c is not dead however because it is faster
basically, to do c++ you need to know c -- sure you cant use classes and such in c code, but instead you just use more function calls from other headers (stdio with printf instead of iostream with cin/cout)
lastly, you can still use old file code in widows -- i use _open and _close and such -- you can have more files open that way than you can with streams
-PoesRaven
Advertisement
C++ is a hybrid language combining structured programming with oop. The C++ structured stuff is the same as C. The only difference is the standard library stuff. And you need a reference book for that stuff anyway. Don''t waste your time sweating over this, just learn C++, get a C reference book, read through it once and put it on your bookshelf.
C is _NOT_ dead!

Sure, C++ is great! If you''re doing a big project (yeah gaming programming involves that), alone or not, it''s great for getting a good structure. But then again, lets say you were to write as small console application to convert bitmaps from diffrent bitdetphs...would you do it in C++ with full blown classes and class tempelates and shit? Or in C, straight and clear, and get it done in 10 minutes? Learn both C & C++. I started out in C when i was 14, got a book at the library, wasnt hard i might add. Then learning C++ was a simple task. Another reason of knowing/coding C is that more people know it, actually i think about that 50% if not more of all code done today is pretty straight C. Have an open mind, learn them both! Go for assembly too while you''re at it
Listen up, everybody!

C++ is great for servers, business apps, and that stuff. But if you plan to go with game programming, you''ll need to learn about C first. For one thing, it''s faster. Second, it''s not as complex as C++, and since game programming is mostly data manipulation, the simpler it is, the less bugs it will have.

I don''t mean that you should throw away C++. I simply mean that if you plan to be a game programmer, you should study C first.
- DarkMage139
darkmage, most of todays cutting edge games are done in C++. why you might ask yourself? its more structured and of course, the encapsulation is great! most things can be done in C++ without any significant loss of speed, but then again, not everything. thats why you program those critical but even so essential parts in assembly.

Edited by - Staffan on 1/22/00 4:14:06 PM
Actually DarkMage139, C++ helps in preventing bugs in the first place. C code is much more prone to bugs.
------------------------------"My sword is like a menacing cloud, but instead of rain, blood will pour in its path." - Sehabeddin, Turkish Military Commander 1438.
C++ is only slower than C is you use a bad compiler, or if you don''t know what the hell you''re doing.
This is my signature. There are many like it, but this one is mine. My signature is my best friend. It is my life. I must master it as I must master my life. My signature, without me, is useless. Without my signature, I am useless.
I agree, if you use the same compiler for C or C++, it'll compile the same either way.

For games I don't see why you wouldn't want to use C++. With OOP, you can have each character a class and just tell a character "moveTo(x,y)" and your class takes care of how the animation should work for the character to move to that location. Anytime you deal with virtual objects, you'll almost always benefit from using OOP.

Besides, most advancements in programing deal with C++, not C. Almost all the newest compilers can compile C++, and if you ever decide to learn Java, you'll already have an idea on how to structure your programs.

BTW: I don't believe that C++ programs should be totaly object orientated. All the programs I've written have been pretty much procedural. I use OOP as either a database, or to represent a virtual object. I've seen many people who use OOP for all their programs, even those that would be much smaller and faster if written procedurally.

A good example of different ways of programming in C++ can be found at:

http://www.ionet.net/~timtroyr/funhouse/beer/beer_a_c.html#cpp

(scroll down a ways and you'll see the C version of the program)


E:cb woof!

Edited by - dog135 on 1/26/00 6:46:31 PM
E:cb woof!

This topic is closed to new replies.

Advertisement