| geezerfud ( @ 2007-03-13 20:09:00 |
Universe Da Capo
I just happened to unexpectedly open a C++ file I was using as a doodlebook once. I'd guess it was fairly recently, though I don't actually remember doodling it (this happens with my physical doodlebooks too. It's great to "re" discover something that is actually a rediscovery). Anyway, that file starts with:
static class Universe {
Universe();
~Universe();
void AddSurface(QuantalSurface);
void RemoveSurface(QuantalSurface);
};
Obviously, I need to use templates, and that "static" in there is pretty much a pusillanimous assumption. Plus, unless constraints are built into the QuantalSurface object, there need to be parameters on the Add and Remove operators. What's lacking, additionally, is some sort of virtual-to-physicality system that this code could ultimately be embedded in. And what are the ethics of providing a destructor at all? One could argue that you have to, because the default destructor would potentially mess with people's lives. On the other hand, if your constructor is all that good, your new object should be able to wring its pointers away from your handles and make itself inaccessible anyway, so investing any intellectual energy in a destructor is simply bad engineering.
I just happened to unexpectedly open a C++ file I was using as a doodlebook once. I'd guess it was fairly recently, though I don't actually remember doodling it (this happens with my physical doodlebooks too. It's great to "re" discover something that is actually a rediscovery). Anyway, that file starts with:
static class Universe {
Universe();
~Universe();
void AddSurface(QuantalSurface);
void RemoveSurface(QuantalSurface);
};
Obviously, I need to use templates, and that "static" in there is pretty much a pusillanimous assumption. Plus, unless constraints are built into the QuantalSurface object, there need to be parameters on the Add and Remove operators. What's lacking, additionally, is some sort of virtual-to-physicality system that this code could ultimately be embedded in. And what are the ethics of providing a destructor at all? One could argue that you have to, because the default destructor would potentially mess with people's lives. On the other hand, if your constructor is all that good, your new object should be able to wring its pointers away from your handles and make itself inaccessible anyway, so investing any intellectual energy in a destructor is simply bad engineering.