Re: Development Style

From: Erwin S. Andreasen (erwin@PIP.DKNET.DK)
Date: 12/16/97


On Tue, 16 Dec 1997, Chris Jacobson wrote:

> My question is this:
> What development styles do people use?

Me and my co-developers have each a Linux machine. They get the base code,
do a 'make checkin' which checks all files in, do changes, test, when
happy they do a 'make diff' which makes a diff file.

They send the diff file to me, I integrate changes into my tree, checking
everything, then when ready I do a 'make diff' as well. This diff is then
uploaded to the MUD server, running Solaris and applied using patch.

This is all described in details in "Using RCS for MUD development"
available from

http://www.abandoned.org/drylock/letters/rcs.txt

> Im not talking making it compile with C++, I mean, fully converting to
> C++, with changing of class names (struct char_data becomes CharData,
> etc), integrating almost all the

Why keep the "Data" part? I called my classes "Character", "Object",
"Room" etc. It's almost as bad as all those structures that prefix their
field members with their name, like timeval has tm_day.

Bitfield become quite managable with templates BTW, I use something like:

// 8-bytes wide bitfield
typedef Bitfield<8, affect_flags> AffectFlags;

affect_flags is an autogenerated table. Affect flags are then defined in a
file, h/affect.h which contains something like:

BIT(AFF, SANCTUARY)
BIT(AFF, FLYING)

etc. Macros are then used to generate an enum which has AFF_SANCTUARY,
AFF_FLYING etc. and the affect_flags table.

Saving is done by doing an:

fprintf(fp, "Affect %s~\n", ch->aff.toString());

which converts the bitfield to a string using that table.

Adding a new affect or deleting an old one involves only delete fields in
h/affect.h : since the actual numbers are not saved anywhere, but strings
only, noone cares about the numbers (well, except the code of course).

One adjustment I still need to make is to bring the enum into the
template; then you can make sure you don't do things like:

ch->aff.set(ACT_AGGRESSIVE);

I plan to document most of the changes, maybe make some c++ code available
(about this c -> c++ conversion) in the MERC Programming FAQ (though much
can apply to any Diku) which is at http://www.abandoned.org/drylock/faq/

 =============================================================================
Erwin Andreasen   Herlev, Denmark <erwin@pip.dknet.dk>  UNIX System Programmer
<URL:http://www.abandoned.org/drylock/>     <*>         (not speaking for) DDE
 =============================================================================


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST