It's amazing how much difference picking the right name for a method makes. In this codebase there are a number of different objects that have an Init method. For about half of these objects Init is used as something that borders on a constructor[0] and for the other half Init is something which actually performs housekeeping to get the object ready to go. All the Init methods are virtual and none of them are used in a way that takes advantage of it. I keep thinking that if we'd chosen Construct and Start for method names that there wouldn't be this kind of confusion.
Particularly this would tend to lead to all methods having a common interface of having Start with no arguments so that final initializations would be a much more uniform process.
--
[0] We often pre-allocate an array of objects and then recycle the memory. This eliminates the issues of allocation time and memory fragmentation. We've got 32 megs of ram to play with including the code, fragmentation is a very serious issue.
Posted by matt at July 29, 2003 02:39 PM