I like C. I prefer it over C++, or rather I like more of C than C++. Although I do use a mixture, It's mostly C code. Anyone else?

dk2
—
2003-04-30T18:49:19Z —
#2

actually I like C++ more than C. C++ is my beloved language

DarkLight
—
2003-04-30T19:28:44Z —
#3

I think object oriented languages are better for Game developing I like object oriented languages more than procedural ones Hence I like C++ more than C

baldurk
—
2003-05-01T17:18:33Z —
#4

that's the only part of C++ I use - classes, for organisation. I don't however use the more advanced OO things, like polymorphism etc. I can see how they would be useful. I definitely couldn't write in pure C++ though unless I was being paid to

DarkLight
—
2003-05-01T20:09:10Z —
#5

in one book of Game programming is written, that in game programming you should not ise these advanced things but keep code simple. However, I use classes and methods but I rarely use virtual ones

CyraX
—
2003-05-02T11:17:44Z —
#6

I like to use C++ - for organization. I would NEVER dare to use Polymorphism - slows down the code. Inheritance - Building hte parent classes before my beloved class is instantiated. C is more mature than C++. You need C++ ONLY for enterprise applications where speed is secondary. In gamez we have speed as the primary thing. Anyone else feels that same? I dont use "new" rather use malloc. Everything that dear Bjarn Stroustrup said was for enterprises... not for us game developers :rolleyes:

anubis
—
2003-05-02T13:54:15Z —
#7

i object that speed is the primary concern in games. it might have been but times have changed and clean and easy to understand code has become more and more important as games and engines grow more and more complex. one good example is the nebula device from radonlabs. the virtual filesystem they created was only possible with oop. it's just amazing to have every object, every texture, every mesh and shader accessible through the console ( look at it if you don't know it, it's a great engine ). so, c++ is my prefered language. my general aproach when designing my code is to seperate it into two catogories.

the code that is not speed sensitive, like loading resources, etc. here i use all the features that c++ gives me to write the cleanest code possible.

parts of the game/engine where speed is important, here i still use c++ but try to minimize the use of polymorphism, virtual functions, etc.

in fact i believe that if you write good c++ code the speed problem is totally irelevant 90% of the time. if you are passing down 5000 triangles in one vertex buffer that one virtual function call won't hurt you but will gvie you an easy way to abstract the gfx api you are using.

baldurk
—
2003-05-02T17:11:03Z —
#8

anubis: I think you may be missing the point. You don't have to use all of C++'s features to write OO code. Simply classes and most likely inheritance. That's all

CyraX: I don't know why, but I find that for more complicated memory allocation commands new is easier than malloc. Just my opinion though

anubis
—
2003-05-02T22:47:36Z —
#9

baldurk : i was just making a point that things that once were useful only in enterprise applications become more important in game development, too.

UnknownStranger
—
2003-05-03T08:20:19Z —
#10

Speed will always be a matter(that's why asm is still used...)... But today, it's mostly much more important to have a clean, flexible code and short development times(that's why asm is only used for single, easy to overview functions... )...

anubis
—
2003-05-03T09:27:43Z —
#11

as i said. you have to find out were to use what.

UnknownStranger
—
2003-05-03T09:31:42Z —
#12

Oops...maybe I should read former posts, before just posting my own opinion... B)

CyraX
—
2003-05-05T14:08:36Z —
#13

I accept that clean code is very important. that was exactly why I said - I USE C++ classes... nothing else is required. Did you ever try playing Q ]I[ on a system that sucks? Perhaps that is when you would realise that speed is important. Without speed your game play goes for a toss. Without Game play - well err... I guess everyone understands. I never said C++ sux or otherwise... I only said C style coding is good.

hanzac
—
2003-07-26T10:46:51Z —
#14

i like c as well ... i can do whatever i want to do even oop

baldurk
—
2003-07-27T08:38:23Z —
#15

OO in pure C? I'd like to see that.

davepermen
—
2003-07-27T12:55:39Z —
#16

oop is nothing magic. its simply much nicer to do in c++ than in c..

but if you want to use templates, you would have to code a preprocessor to preprocess your files before c to implement it..

there is no way to do them in c, except writing the code manually for all different possible types:D

and oop is not slow actually. really not. compilers are aware that people will use it and that they want it fast..:D

hanzac
—
2003-07-27T13:23:20Z —
#17

davepermen: i have the same feeling with you, actually when i want to do something like template in c, i just use the pointer and give the number of bytes and pass the pointer. maybe it is not a convenient way. i like it, and i am just trying to learn.

maybe in real project i will choose c++ or above. :rolleyes:

davepermen
—
2003-07-27T13:41:11Z —
#18

the pointer is less efficient in some situations (ints,floats,etc..), and does not give the same power at all that templates give you:D

hanzac
—
2003-07-27T14:08:00Z —
#19

maybe i have another advantage:

it is dynamic and the template is static once it is compiled.

davepermen
—
2003-07-27T15:20:52Z —
#20

just depends on what you need.. but templates can generate your "dynamic code" as well:D just give them in a pointer:D