C++ sucks for games

From: Neo-LISPer (neo_lisper_at_yahoo.com)
Date: 10/25/04


Date: 25 Oct 2004 05:11:44 -0700

Hey

Recently, I researched using C++ for game programming and here is what
I found:

C++ game developers spend a lot of their time debugging corrupted
memory. Few, if any, compilers offer completely safe modes.

Unsurprisingly, there is a very high failure rate among projects using
C++ for modern game development.

You can not even change function definitions while the program is
running and see the effects live (the ultimate debugging tool).

Alternatively, you can't execute a small portion of the program
without compiling and linking the whole thing, then bringing your game
into a specific state where your portion of the code is being executed.

The static type system locks you into a certain design, and you can't
*test* new ideas, when they come to you, without redesigning your
whole class hierarchy.

C++ is so inflexible, even those who do use it for games, have to
write their game logic in some other language (usually very slow,
inexpressive and still garbage collected). They also have to interface
the two languages.

C++ lacks higher-order functions. Function objects emulate them
poorly, are slow and a pain to use. Additionally, C++ type system does
not work well with function objects.

C++ programs can not "think" of new code at run-time, and plug that
new code into themselves in compiled form. Not easily, anyway.

C++ coding feels very repetitive, for example, when writing class
accessors, you often have to write const and non-const methods with
completely identical function bodies. Just look at STL.

When programming in C++ you feel like a blind person trying to draw
something. You don't _see_ the data structures that your procedures
will operate on. Lisp programming is much more visual.

Constructors and smart pointers make it hard to tell cheap operations
from expensive ones.

C++ lacks automatic memory management and so it encourages copying
objects around to make manual memory management manageable.
Reference-counting schemes are usually slower than modern garbage
collectors and also less general.

Most important, C++ syntax is irregular, and you often find yourself
typing repetitive patterns again and again - a task easily automated
in languages with simpler syntax. There are even books on C++
patterns, and some C++ experts take pride in being able to execute
those patterns with computer-like precision - something a computer
should be doing to begin with.

C++ programs are slow: even though the compilers are good at
micro-optimizing the code, programmers waste their time writing
repetitive patterns in C++ and debugging memory corruption instead of
looking for better algorithms that are far more important for speed
than silly micro-optimizations.

It's hard to find good programmers for C++ projects, because most of
the good programmers graduated to languages like Lisp or avoided C++
altogether. C++ attracts unimaginative fellows with herd mentality.
For creative projects, you want to avoid them like a plague.

It is my opinion that all of the above makes C++ a very bad choice for
commercial game development.



Relevant Pages

  • C++ sucks for games
    ... I researched using C++ for game programming and here is what ... C++ game developers spend a lot of their time debugging corrupted ... C++ lacks automatic memory management and so it encourages copying ...
    (comp.lang.lisp)
  • Re: Update: The use of the SX processor instead of a Basic Stamp
    ... a custom game based on the same hardware. ... guys went through with the custom AC/DC project. ... leave the computer for programming:). ...
    (rec.games.pinball)
  • Re: New To Game Proogramming where to start ???
    ... I have been in Programming for many years but now make ... Please also suggest the books that are worth reading in terms of game ... You need to separate the ideas of "game programming" from "graphics ... university precalculus course you get about a week to learn trig. ...
    (comp.programming)
  • Re: Lords of DarkHall - Early Beta - Looking for CONSTRUCTIVE criticism
    ... let me apologize to the people above having trouble downloading ... or really done any web programming at all ... stats are hidden from the player - for example, ... know what people like in a roguelike game. ...
    (rec.games.roguelike.development)
  • Re: Sega Classics Collection - Thoughts...
    ... the fucking game. ... Why is your character so fucking dumb that they think ... definite step down from Outrun 2(which, of course, they weren't trying ... shitty programming. ...
    (rec.games.video.sega)