[wingide-users] Enhancement: List/Goto caller (Goto sourcereverse)
tms at zeetix.com
Wed Jun 4 10:56:39 MDT 2008
> As for false positives, maybe you need to be more creative in nameing
> funcitons :-)
Well, all kidding aside, it isn't function names that create the false
positives. After all, in a duck-typed system like Python any function with
the same name can be assumed to provide related behavior.
Even in a duck-typed system, it can be very advantageous to limit search
results for callers to methods of the same class or of the same class
hierarchy. Since the search-in-files function operates at the file level,
attempts to cobble together such limits therefore couple the class hierarchy
with the file hierarchy of the source code that provides those classes. This
coupling is often not just wrong but often badly wrong, especially if
multiple inheritance is used.
The perhaps unfortunate reality is that the search in question -- "callers
of a function" -- is a property of the *dynamic runtime environment* and not
the files that comprise the source. The runtime environment is nearly
orthogonal to the source code that created it, and perhaps someday our
development tools will better reflect this reality.
Meanwhile, the false positives are generally caused by false aliases in
things like comment strings, doc strings, commented-out code, test files,
and all that stuff.
File-based approaches are perhaps the best we can do for now, but none of us
should forget that we can and hopefully someday will do very much better.
Smalltalk-82, which provided all of this, is after all more than twenty-five
years old. It is probably older than many of the readers of this exchange.
More information about the wingide-users