Right, this is the way we would eventually solve the problem and make things more consistently-named. It’s a long road, though, and in practice deprecating functions has had inconsistent success (people tend to continue using the functions they’re familiar with, long after they have been officially deprecated). But we could get there eventually.
Still, as ynjh_jo pointed out, having a more consistent naming in Panda doesn’t really solve the fundamental problem here. There are bigger issues, and to a certain extent, making the method names consistent may actually hide some of these issues and lead to bigger, harder-to-solve problems for naive programmers.
As an example: suppose we agreed that all objects should have a destroy() method which cleaned them up properly. So we define a NodePath.destroy() which does the same thing that removeNode() does now. And we also let DirectGuiWidget.destroy() continue to do what it does now. And so on. So now everything can be cleaned up with destroy(), and there’s one less set of weird rules you have to learn to use Panda. Great!
But wait! It’s not that simple. Because DirectGuiWidget.destroy() does more than destroy itself; it also destroys all of its children that are also DirectGuiWidgets, and their children as well, and so on. This is an important convenience because frequently you create hierarchies of these things, and it would be a nuisance to have to store pointers to every one of these and call destroy() on each one.
On the other hand, NodePath.removeNode() does no such thing. It doesn’t do anything to its children at all; and this is important too because we call NodePath.removeNode() a lot, and we don’t want to pay the cost of walking the entire hierarchy looking around for things that need to be cleaned up every time we call it.
So, now we get used to calling thing.destroy() to clean up a DirectGuiWidget, and thing.destroy() to remove a hierarchy of nodes, and we forget that really they are different things, and now we will try to call root.destroy() on a plain NodePath to remove a hierarchy of nodes that includes DirectGuiWidgets, but the DirectGuiWidgets won’t get cleaned up. And we won’t know why, and we may not even notice the problem until much later, when our application crashes mysteriously.
So at the end of the day, we’ve just moved the problem, from a relatively small problem that will confuse new Panda users for a day or two, to a much more subtle, more difficult to diagnose problem that could stump expert Panda users for a week or more.
I’m not trying to justify the mishmash of naming conventions, or say that we shouldn’t attempt to make Panda more self-consistent. I’m just pointing out that the problem is bigger than it first appears.
David