help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exploring a code base?


From: Dmitry Gutov
Subject: Re: Exploring a code base?
Date: Sat, 7 Nov 2020 21:40:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 07.11.2020 15:26, Yuri Khan wrote:
On Wed, 28 Oct 2020 at 03:56, Dmitry Gutov <dgutov@yandex.ru> wrote:

Speaking of Xref, we could add some new commands: to remove items from
the list, to undo removals. And a stacking for searches, so you could go
back to the previous search result. Not sure how much that will help.

A stack/history would be very nice, yeah. To the point that I actually
caught myself trying to press ‘l’ in xref and grep result buffers.

This shouldn't be too different to implement either. You can start with a bug report, and then we'll see who has the time to work on it first.

I don't have a solution, personally, and I usually work in a dynamic
language where this isn't a very feasible thing to do.

“We know that it has no solution, too. But we wish to learn how to solve it.”

;-)

I’m working in Python, which is a dynamic language. Theoretically, in
Python one does not have to declare argument and return types, and the
call graph can change its structure at run time because functions are
first-class values and because of class-based polymorphism. In
practice, my project is mostly type-annotated (with mypy
sanity-checking the annotations), and the use of polymorphism and
dynamic binding is limited.

Python still has it easier than Ruby, because at least you have to explicitly import all packages and/or used functions in a given file. That means you can generally be sure where any function and class definition is from.

Of course, heavily dynamic code throws a wrench into this, but it's usually in the minority.

* https://github.com/beacoder/call-graph uses GNU Global.
* Here's a recipe for a graphical call graph:

Yeah, there exist many tools that attempt to take in the whole project
and generate a complete call graph. In my experience, most of the
time, for any project more complex than Hello World, the resulting
graph is too messy to be helpful.

The call-graph features that looked relevant to me are how (looking at the list of commands and the gifs) you manually choose which nodes in the tree to expand further (which is necessary, since otherwise the tree can become very wide/unmanageable), as well as remove elements from it interactively.

But yeah, in the current state it's definitely not ideal.

Eric S. Raymond once wrote up[1] the difference between automatons
(programs that attempt to solve the problem fully without human
involvement) and judgment amplifiers (programs that help the human
solve the problem by automating parts of the process). I think I’m
looking for a tool in the latter category.

It's a more difficult category, too, I think.

One has to balance the necessary features for the task at hand, and flexibility (to enable some set of related tasks), and efficiency as well (to minimize the manual work anyway).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]