Freecell Solver - Evolution of a C ProgramWhy not C++?

8. Why not C++?

Markus Oberhumer (of PySol fame) asked if I thought about converting Freecell Solver to C++. (I suppose he meant with STL, templates and all). Here is a full answer why I'm not going to do it:

  1. The solver is already working in ANSI C.
  2. The code is not overly object-oriented. Whatever OOP concepts exist there fit well enough within what ANSI C gives me.
  3. C++/STL may make it slower, perhaps even considerably. I'd rather not spend time risking something like that, only to roll it back later.
  4. ANSI C compiles much faster. (at least with gcc)
  5. ANSI C is cleaner, more portable and causes less unexpected problems than C++.

I'm more willing to integrate C++-derived features there into the ANSI C code. Things like namespaces, (non-inherited) classes, or inline functions. However, for the time being, I'd like to maintain the code as pure ANSI C.

For that matter, some of the gcc extensions can prove very useful too, but I cannot use them either.

Written by Shlomi Fish