[crossfire] Code cleanlieness and server stability

Alex Schultz alex_sch at telus.net
Sun Feb 26 14:44:50 CST 2006


Hi,

Lately, I was reminded a bit of how there often seems to be many bugs in 
CVS and server stability is in some ways rather poor. I was thinking a 
bit, and a large part of it is, runaway null pointers, and developers 
not thinking of all the areas that they might be affecting when making 
changes to some part. I was thinking that it would be a good idea to 
brainstorm some ideas on how these issues could be reduced. Here are 
some ideas that came to mind for me, feel free to suggest your own of 
course.

-Encourage use of doxygen generated code documentation to verify what 
things you may be affecting: I.e. 
http://crossfire.real-time.com/code/server/index.html (would need a more 
uptodate version than that to be of much help though)

-Sometimes when a bug gets fixed, the person who caused it might not 
know, and therefore the developer is more likely to do similar things 
again without knowing it. It might not be very difficult to make a small 
script that can check with cvs commit last changed a given line of code 
or function in the code, and one could easily notify the person who made 
the mistake of what they did wrong. This might be a bit of an 
over-engineered thing, but right now, just brainstorming ideas.

-Clean up the code structure: IMHO, the first step would be moving 
functions around between files and making that organization a bit 
clearer. Also, though plugins might have some merits, they are not the 
way to go for achieving cleaner code. Greater separation of parts would 
be good, but plugins will just have a bit of overhead and similar 
separation can be achieved just moving around which code is in what 
files. After the code is moved around between files, I think the next 
step to do would be removing redundant code which there seems to be a 
bit of (i.e. in many places, there are many separate implementation of 
very similar functions that should be implemented as a single function, 
with perhaps some extra arguments to very slight variants).

    Alex Schultz

(the onomatopoeia in the subject was mere coincidence)



More information about the crossfire mailing list