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:
- The solver is already working in ANSI C.
- The code is not overly object-oriented. Whatever OOP concepts exist there fit well enough within what ANSI C gives me.
- 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.
- ANSI C compiles much faster. (at least with gcc)
- 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.