[bind10-dev] whether to merge incomplete stuff

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Fri Feb 25 20:35:02 UTC 2011


Via cppcheck reports (in branch trac613) I noticed a few incomplete
(actually "empty") methods have been merged.  These are, specifically,
as follows:
 - MessageCache::dump()
 - MessageCache::load()
 - MessageCache::resize()
 - RRsetCache::dump()
 - RRsetCache::load()
 - RRsetCache::resize()

And, for example, the definition of MessageCache::dump() is this:

void
MessageCache::dump(const std::string&) {
    //TODO
}

These methods are not virtual and don't have to exist to make the
class compile, so they are simply unnecessary (everything builds and
works fine even if we actually remove them from the code).

I heard there's not a plan to implement them in a short term (e.g.,
not within "year 2").  In such a case I propose removing them for the
following reasons:

 - often, things that are to be implemented "in middle term" won't be
   implemented soon or even never implemented.  In the mean time they
   remain as a build overhead (e.g., it may require a header file to
   be included that wouldn't be necessary otherwise), and we also tend
   to forget cleanup the dependency if and when we finally decide to
   not to implement the incomplete stuff.
 - also often, when we really want to implement it, we find we
   actually need a different interface.  the overhead/cleanup issues
   in the first bullet also apply here.
 - as a practical matter in this specific case, I needed to suppress
   some types of check in the cppcheck, file-wide, due to the
   incompleteness of these methods.  This means we may miss some bad
   styles or bugs in the same file.  We could make the suppression
   setup more selectively, but it has its own overhead and drawbacks.
   Simply removing incomplete and unused stuff and removing the
   suppression setup are much more simpler.

So, my suggestion is to remove the declaration and (empty) definition
of these methods, and just note a possibility of these features as a
future \todo item in comments.

Does that make sense?

---
JINMEI, Tatuya



More information about the bind10-dev mailing list