On Tue, Feb 17, 2009 at 07:10:22PM +0100, Per Inge Mathisen wrote: > The code is buggy, and we do not have a process in place to ensure > that it gets better. I dare say that if the only thing that keeps > Warzone from sliding from bad to worse in terms of bugs is hard work, > there is no chance that we will not get to the point of stability > where we want to be.
I personally think there is the motivation to improve code quality in our team, it's just organisation of it that's lacking. > The plan I would suggest is to start moving code into a new directory, > lib/base/, where we put functions that can pass the following > criteria: > 1) can be relevant for more than one application, Lets adhere the YAGNI principle here: don't write/modify/update/etc. code just because it "can" be relevant for more than one application. I'd like to be very sure that it'll be used in more than one application. OTOH reducing code interdependencies (and as a result making librarification easier) is probably not such a bad idea. > 2) has *at least* one unit test, > 3) uses *no* globals, IMO it are the large amounts of globals that are the greatest single source of problems. In part because they make unit testing difficult, partly because they reduce opportunities for parallelisation (e.g. threading), but mostly because they increase the difficulty of understanding how different parts of the code interact. I think we might benefit from somehow automatically generating a list of globals. We can then categorise this list (preferably by means of in-code comments with some special syntax) to distinguish "good" and "bad" globals. > 4) and follows the coding style guide. I'd say that is the easiest thing to "fix". Though I'd rather not use the "run indenting program X" approach to preserve "blame" history. > I would like to start porting the map loading code there. If you like > the idea. Then hopefully we could all pitch in and port the functions > you are more familiar with and soon we will have a new, shiny and > improved Warzone codebase that everyone loves working with. Oh I most definitely like the idea ;-). I just think that in some cases we might need to port on a per-file basis, rather than a per-function basis, this due to the use of globals (the static ones). And I'd rather not make file-globals completely global halfway in the process of porting. -- Giel
signature.asc
Description: Digital signature
_______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev