[CF List] problem with some diseases

Raphaël Quinet quinet at gamers.org
Fri Jul 12 02:27:25 CDT 2002


On Wed, 10 Jul 2002 07:39:37 -0700, "Peter Mardahl" <
     
     peterm at tonks.EECS.Berkeley.EDU
     
     > wrote:
>
     
      And to do all this I had to use the available crossfire object
     
     >
     
      items as parameters, which means for some of the parameters I
     
     >
     
      was able to use sensible names like "Cha" for reducing charisma,
     
     >
     
      for others, I had to do things like what you object to.
     
     >
     
     
     >
     
      Anyway, this somewhat lame situation could be fixed by
     
     >
     
      doing a re-write of Crossfire in C++, a measure no one has
     
     >
     
      stepped forward to do....
     
     
This is a bit off-topic, but here are my 2 silver coins on this issue:
I don't think that re-writing any part of Crossfire in C++ will really
improve the code.  I think that it would be better to re-structure
some parts using plain C with some object-oriented concepts, based on
what is done in glib and gtk+.  This could be done step-by-step
instead of having to re-write everything at once.

I have seen several projects moving from C to C++ and in most cases
(with the exception of high-level graphical interfaces) there was
little or no gain in efficiency or maintainability of the code.  This
is due in part to the fact that some programmers (experienced or not)
tend to "over-design" some classes and add too many sub-classes.  As a
result, it is not easier than before to have a good overview of how
the code works and some of the problems that existed in the previous
incarnation of the code are still there but simply hidden.  For
example, several singleton objects carrying a lot of data (sometimes
inherited from parent classes) are similar to static global variables
and cause the same problems, but they are simply less visible.  Some
of these problems are also present in the projects that attempt to use
object-oriented concepts in plain C, but they seem to be less frequent
or less severe and in the end they have less code bloat (I cannot
explain why, but it just seems to be like that for the projects that I
have observed).

C++ has many advantages, but it also has many disadvantages.  For a
collaborative project like Crossfire, I am skeptical about the total
gains that could be achieved by a re-write in C++.  I would rather
recommend some "object-oriented C" like in glib and gtk+.

-Raphaël

    
    


More information about the crossfire mailing list