C vs C++

Started by
6 comments, last by lpcstr 12 years, 10 months ago
which programming language is better in terms of creating a game engine?

Advertisement
Don't use C for a modern game.. Unless you plan on putting it on some embedded system you couldn't find a C++ compiler for. Also don't necessarily write it in C++ (it is a fine choice though), Consider Java or C#.
Your post is titled "Which programming language is better in terms of creating a game engine?" yet your poll is titled "Which language do you find easier?"

I find C++ easier, because my programming and thinking is very object oriented, and although anything I program could also be done with C, I find classes, templates and new/delete memory management to be invaluable tools for knocking up projects quickly, efficiently and with minimal amount of bugs.

As for which is better for a game engine, that's way too broad a question. Which type of game is the engine suited for? Which platforms are you targeting? Who will be using the engine? What compiler and version(s) will be in your toolchain? Which external libraries are you hoping to use along the way? Which language do you know more of? That's just a few of a thousand questions I could ask, but it all boils down to "with which language could you get a game finished quicker?"

...and don't make engines, make games.

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

What is your level of experience?

There is no magic bullet in terms of languages. What language you write your engine in has a lot to do with which languages you are most experienced in and what are the requirements for the engine.
I agree with deadstar, the poll and question certainly could be more specific ( or at least more general for presentation ). As for the underlined question not directly said ( except for perhaps from deadstar ) "What language is easier to create a game engine with? C or C++?", I'd say not to choose between them. C++ is what I use and think in, as I love the OO style of development, especially with games. C however still has many resources created using it, and that's why C++ still supports the subset C, so C++ programmers can still use the C resources.

You honestly shouldn't choose between the two, as many engines and games are created with more than one language. Many have at least one programming language and one scripting language for the project. I've seen projects with 8 or more languages being used, as they are open-source and many programmers from different reaches of their own languages come together to contribute. In the end, it's "What's easier for you".
Mu
Either. Neither. Both.

A programming language is just a tool. When you want to do a job you reach into your toolbox, find the most appropriate tool, and use it to get the job done. Nothing else.

That said, I would favour the C-like subset of C++ over C any day, and would use that in preference to C unless I was on a project that was already committed to C.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


That said, I would favour the C-like subset of C++ over C any day, and would use that in preference to C unless I was on a project that was already committed to C.


I agree with that. I realize that traditional OOP isn't right for every solution, but who's to say you need to use C just because you don't want to use OOP? On the other hand, there are projects written in C who attempt to use a OOP design, YUCH.

I use Linux a lot and unfortunately for me, *nix is predominantly C, and I tend to dislike working with it.

This topic is closed to new replies.

Advertisement