baldurk at April 30th, 2003 13:15 — #1
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 at April 30th, 2003 14:49 — #2
actually I like C++ more than C. C++ is my beloved language
darklight at April 30th, 2003 15:28 — #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 at May 1st, 2003 13:18 — #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 at May 1st, 2003 16:09 — #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 at May 2nd, 2003 07:17 — #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 at May 2nd, 2003 09:54 — #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 at May 2nd, 2003 13:11 — #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 at May 2nd, 2003 18:47 — #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 at May 3rd, 2003 04:20 — #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 at May 3rd, 2003 05:27 — #11
as i said. you have to find out were to use what.
unknownstranger at May 3rd, 2003 05:31 — #12
Oops...maybe I should read former posts, before just posting my own opinion... B)
cyrax at May 5th, 2003 10:08 — #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 at July 26th, 2003 06:46 — #14
i like c as well ... i can do whatever i want to do even oop
baldurk at July 27th, 2003 04:38 — #15
OO in pure C? I'd like to see that.
davepermen at July 27th, 2003 08:55 — #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 at July 27th, 2003 09:23 — #17
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 at July 27th, 2003 09:41 — #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 at July 27th, 2003 10:08 — #19
maybe i have another advantage:
it is dynamic and the template is static once it is compiled.
davepermen at July 27th, 2003 11:20 — #20
just depends on what you need.. but templates can generate your "dynamic code" as well:D just give them in a pointer:D
next page →