I''ve heard that they''re both the most powerful for game writing. I know that C++ is OOP, which is good. Can I include sound and graphics with this code? Somebody please help
OOP isn''t necessarily good, it''s what you do with it that makes it good or bad. I personally still use C, I don''t see a need for Classes in a video game really, so I just get by with structs and regular functions. Anyways, by your question, it looks like you need to go have a look at this link to help you out.
------------
- outRider -
------------
- outRider -
If you are planning on doing game programming, you should go for C++, because you are allowed to do OOP. Classes and so, which are very powerful. I use MSVC++ and i love it, but you could use DJGPP as well (www.delorie.com).
And of course you can do sound and graphics in both C and C++, and if you use MSVC++ you can also use DirectX. I dont know if you can use DirectX with DJGPP, do someone know? But then you have the choice of using allegro which is a gameprogramming library (sound, input, graphics....) for DJGPP.
Hope this helps,
René
And of course you can do sound and graphics in both C and C++, and if you use MSVC++ you can also use DirectX. I dont know if you can use DirectX with DJGPP, do someone know? But then you have the choice of using allegro which is a gameprogramming library (sound, input, graphics....) for DJGPP.
Hope this helps,
René
Just trust me on this one, game companies are looking for people who know C and C++. Learn them both. The more you know of each the better the chance you''ll have at getting a job.
October 10, 2000 04:53 PM
I don''t see the point of the C or C++ debate.
They are the same language. If you know C you know a lot of C++
and if you know C++ then you already know C .
They are the same language. If you know C you know a lot of C++
and if you know C++ then you already know C .
I don''t totally agree with that. I personally use C++. I love it, and I love OOP for some reason. I use it all the time. But I also use ASM for time critical portions. Anyway, I use C++, and like it the best. Someday C++++ will be out, and that will be the new hit. IMO, the best advise I can give, learn them both. Learn as many languages as you can, and learn them well. Makes you look good, and have a good chance of getting a job. I know 8 languages, plus some odd ball things. I know some better than others, and am still trying to learn 10 total, then stop, and learn them as down pat as I can.
=====
Khaos
=====
=====
Khaos
=====
If you learn C first, you''ll be learning a nice, fast language with semi-OOP features (structs. Maybe it''s OOP/10 ). Then, when you eventually decide to learn the features that C++ added, you''ll say something like, "Those are nice features, but I''ve never needed them before. Why would need them now?" You''ll stick to your C coding style, and you''ll be a happy little programmer. There''s nothing wrong with that.
Learn C++ first, however, and the situation changes dramatically. You''ll see that, in actuality, C and C++ are two very different languages. Features like templates (my personal favorite C++ feature) allow you to write less code that does more in less time (phew! That was one weird sentence). As a C++ programmer, you''ll be able to write tight code that''s easily maintained and reused.
Is C++ better than C? Not really. Anything that can be done in C++ can be done in C. My point is this: learning C++ first allows you to write code that is fast, short, and maintainable.
I hate to say this, but C promotes bad coding habits that you''ll take into more modern languages. It''s possible to forget these habits and learn OOA/OOD/OOP, but this does nothing but give you extra work.
In the end, this piece of advice will always get you through your programming problems: Do what Cramack does. Quake ]|[ was written in C. DooM 3, however, is being developed in C++.
Learn C++ first, however, and the situation changes dramatically. You''ll see that, in actuality, C and C++ are two very different languages. Features like templates (my personal favorite C++ feature) allow you to write less code that does more in less time (phew! That was one weird sentence). As a C++ programmer, you''ll be able to write tight code that''s easily maintained and reused.
Is C++ better than C? Not really. Anything that can be done in C++ can be done in C. My point is this: learning C++ first allows you to write code that is fast, short, and maintainable.
I hate to say this, but C promotes bad coding habits that you''ll take into more modern languages. It''s possible to forget these habits and learn OOA/OOD/OOP, but this does nothing but give you extra work.
In the end, this piece of advice will always get you through your programming problems: Do what Cramack does. Quake ]|[ was written in C. DooM 3, however, is being developed in C++.
As the complexity of a program increases it burdens the programmer's memory and ability. There exist a level of complexity that no single person can effectively advance the code.
It is a widely agreed upon in the field of computer science that procedural based coding breaks down in the vacinity of 100,000 lines of code. I supose with a talented team, this limit could be extended, to say double, triple, or even five? ten times? But it matters not, the complexity ever increases at advancing rates.
OOP coding breaks down as well, the limit is not as agreed upon as procedual based coding, but it is on the order of 100,000,000 lines or so. More sophisticated progamming models are constantly being developed in an attempt to push this envelope. (dlls, com/com+, and a bunch of other stuff i know little about, are attempts as such)
While it is true that OOP techniques can be used with C, C++ is designed for object orientated programming. Eventually game development will reach a point that oop coding will be a neccessity, if it has not already.
Every line of C code will compile in a C++ compiler (or am I mistaken? I guess some attention to casting must be made in the C code).
Many people feel the C is adequate for games, and it is adequate.
But if you are going to use an OOP approach, why would you not use the tool designed for it? Even if all you use C++ for is to include functions in thier respective structs, you've added a level of organization to your code. And if you really hate obj->Method(), figure out a cever to define to make it look how you like it, just like Andre does
I liked DOS too, but Windows 2000 really is a much nicer OS to work with and program for.
Were people twenty/thirty years ago as reluctant to give up Fortan, COBOL, or asm in favor of C?
...
I agree that everone claiming to be a computer scientist or software engineer you should definetly know what you can and cannot do in C/C++. And that "you can't pass parameters to constructors in VB, and that's why I won't use it on projects, period - don't get me started on pointers."
Templates', class', operator overloading, and inheritance are some good things about using C++; polymorphism through virtual's is not
Edited by - Magmai Kai Holmlor on October 10, 2000 11:13:01 PM
It is a widely agreed upon in the field of computer science that procedural based coding breaks down in the vacinity of 100,000 lines of code. I supose with a talented team, this limit could be extended, to say double, triple, or even five? ten times? But it matters not, the complexity ever increases at advancing rates.
OOP coding breaks down as well, the limit is not as agreed upon as procedual based coding, but it is on the order of 100,000,000 lines or so. More sophisticated progamming models are constantly being developed in an attempt to push this envelope. (dlls, com/com+, and a bunch of other stuff i know little about, are attempts as such)
While it is true that OOP techniques can be used with C, C++ is designed for object orientated programming. Eventually game development will reach a point that oop coding will be a neccessity, if it has not already.
Every line of C code will compile in a C++ compiler (or am I mistaken? I guess some attention to casting must be made in the C code).
Many people feel the C is adequate for games, and it is adequate.
But if you are going to use an OOP approach, why would you not use the tool designed for it? Even if all you use C++ for is to include functions in thier respective structs, you've added a level of organization to your code. And if you really hate obj->Method(), figure out a cever to define to make it look how you like it, just like Andre does
I liked DOS too, but Windows 2000 really is a much nicer OS to work with and program for.
Were people twenty/thirty years ago as reluctant to give up Fortan, COBOL, or asm in favor of C?
...
I agree that everone claiming to be a computer scientist or software engineer you should definetly know what you can and cannot do in C/C++. And that "you can't pass parameters to constructors in VB, and that's why I won't use it on projects, period - don't get me started on pointers."
Templates', class', operator overloading, and inheritance are some good things about using C++; polymorphism through virtual's is not
Edited by - Magmai Kai Holmlor on October 10, 2000 11:13:01 PM
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
C and C++ are indeed two separate languages. One of my personal pet peeves people who talk about "C/C++". C/C++ isn''t a language, it''s undefined behavior. It was once said that "C is programming, and programming is C", and this is still true. C++ has not replaced C. 90% of the time, though, you can have your pick of the two, and which one you choose is up to you. It really just boils down to personal preference. I, personally, don''t care a whole lot for C++; it has confusing and inconsistent syntax, among other things, but that''s just me. OOP can be done in C, you don''t need classes for OOP. OOP is simply a programming paradigm, it doesn''t have to be integrated with a particular language to do it. if you have a structure, you can define a set of functions that take a pointer to that structure as an argument and manipulate the data in it. That structre and those functions are your object. In fact, that''s exactly how C++ implements member functions. My point, then, is this: Learn procedural programming (C) first, then, once you understand the basic concepts of programming, you can investigate other programming models, such as oop, and decide for yourself which is best.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement