Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2000:
[Freeciv-Dev] Re: OO model for Freeciv?
Home

[Freeciv-Dev] Re: OO model for Freeciv?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: OO model for Freeciv?
From: Lalo Martins <lalo@xxxxxxxxxxxxxxx>
Date: Sun, 30 Apr 2000 14:24:01 -0300

On Sun, Apr 30, 2000 at 09:45:03AM -0400, Cameron Morland wrote:
> On 30 Apr 2000, Falk Hueffner wrote:
> 
> > Well, nevertheless I think we should stick to C :-) It's just that the
> > arguments here seem silly. For example, execution speed is pretty
> > irrelevant for FreeCiv IMHO, as long as it isn't twice as slow or
> > something.
> 
> I must disagree, myself. Sid's Civ on DOS was nice on a 286, and crazily
> fast on a 386. I have a Sparc 2, and FreeCiv is acceptably fast with a
> normal map, and painfully slow with a large one. Making it significantly
> slower would make it unplayable for me.

The fact that C++ programs are slower than C is mostly a
legend; search for the Stroustrup interview in Slashdot
( http://slashdot.org/interviews/00/02/25/1034222.shtml ).

Most modern C++ compilers do a pretty good job at optimizing. A
better job than you'll do manually in C.

Writing C code with _no_ object orientation or containers _at_
_all_ will produce faster code than writing it in C++ with
objects and containers. D'oh.

But writing it in C emulating objects (in some dirty variation
of the GTK model) and writing your own containers, with the
best compiler optimization, and after stripping, will almost
always produce code which is slower, bigger, buggier and less
maintanable than the equivalent C++/STL code.

If there was, even remotely, the chance that Freeciv could be
upgraded to C++, it could be done by a separate group of madmen
in a branch, and when ready, tested for performance. I for one
wouldn't mind working on such a project and then throwing all
my work in the trashcan if it doesn't turn out better than the
C version.

[]s,
                                               |alo
                                               +----
--
          Hack and Roll  ( http://www.hackandroll.org )
            News for, uh, whatever it is that we are.


http://www.webcom.com/lalo           mailto:lalo@xxxxxxxxxxxxxxx
                 pgp key in the personal page

Brazil of Darkness (RPG)    ---     http://zope.gf.com.br/BroDar



[Prev in Thread] Current Thread [Next in Thread]