[Freeciv-Dev] Re: OO model for Freeciv? (was: #define $#@$%! template)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
"Peter Schaefer" <schaefer@xxxxxx> writes:
> I personally dont like the C++ & STL; thats just me I guess; there
> are no warnings for more stupid mistakes than u can do in C.
Are you joking? With the STL, the compiler can check type consistency
at compile time; in C everything crashes silently if you push a city
into a list and pull a unit.
Also you don't have to care for memory managenment and the code is
shorter and more readable.
Using STL would be the #1 reason for me to use C++ for FreeCiv,
because container and string handling in C really sucks. For example,
if I want to add a '.' to a string, I write
s += '.';
What is the shortest way to express this in C?
char* newspace=(char*) malloc(strlen(s) + 1);
strcpy(s, newspace);
free(s);
s = newspace;
s[strlen(s) + 1] = '.';
or something.
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.
Falk
- [Freeciv-Dev] Re: OO model for Freeciv? (was: #define $#@$%! template), Peter Schaefer, 2000/04/27
- [Freeciv-Dev] Re: OO model for Freeciv? (was: #define $#@$%! template),
Falk Hueffner <=
- [Freeciv-Dev] Re: OO model for Freeciv?, Cameron Morland, 2000/04/30
- [Freeciv-Dev] Re: OO model for Freeciv?, Tomasz Wegrzanowski, 2000/04/30
- [Freeciv-Dev] Re: OO model for Freeciv?, Lalo Martins, 2000/04/30
- [Freeciv-Dev] Re: OO model for Freeciv?, Sam BC, 2000/04/30
- [Freeciv-Dev] Re: OO model for Freeciv?, Dan Gohman, 2000/04/30
- [Freeciv-Dev] Re: OO model for Freeciv?, Thue Janus Kristensen, 2000/04/30
- [Freeciv-Dev] Re: OO model for Freeciv?, Dan Gohman, 2000/04/30
- [Freeciv-Dev] Re: OO model for Freeciv?, Sam BC, 2000/04/30
|
|