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?
actually I like C++ more than C. C++ is my beloved language
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
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
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
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:
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.
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
baldurk : i was just making a point that things that once were useful only in enterprise applications become more important in game development, too.
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... )...
as i said. you have to find out were to use what.
Oops...maybe I should read former posts, before just posting my own opinion... B)
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.
i like c as well ... i can do whatever i want to do even oop
OO in pure C? I'd like to see that.
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
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:
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
maybe i have another advantage:
it is dynamic and the template is static once it is compiled.
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 →