Up to Main Index Up to Journal for February, 2013 JOURNAL FOR THURSDAY 28TH FEBRUARY, 2013 ______________________________________________________________________________ SUBJECT: Back to coding after a short break DATE: Thu Feb 28 21:31:00 GMT 2013 Last week was a bust - heavy cold, cough, fuzzy head, generally bleugh :( So Tuesday - feeling somewhat better - I tried picking up where I'd left off hacking WolfMUD's resource processing into shape. Took a while as I'd been making changes all over the place trying different ideas. Once I'd figured out where I was and what I'd been doing I didn't like what I was seeing. The code for loading and parsing data files was becoming very invasive with tendrils reaching out all over the place. In the end I called it a night and decided to ponder things for a while. Last night I once again sat down to try and sort out the mess I'd made. One of the things I don't like are the number of methods needed to create things. For example a location now has New, Unmarshal and Initialize methods. New allows you to create a location passing in parameters. To load a location from a data file you first have to call Unmarshal for all of the locations and then Initialize to link them all together via references. This seems more than a little messy. There is also the fact that the loader needs to know about all the different types it can load. At the moment I'm using a map of functions for this which itself is messy as the function return types don't seem to be evaluated to see if they comply to an interface type - not sure if this is a bug in Go, a not very informative compiler error message or just my code but I'm looking into it. Still it's better to sort all of this out now and get it right than to release the code and have to deal with a tonne of legacy decisions later on. -- Diddymus Up to Main Index Up to Journal for February, 2013