Live data from Hacker News

Untapped Way to Learn a Codebase: Build a Visualizer

jimmyhmiller.com

31–40 of 54 posts

Re: Untapped Way to Learn a Codebase: Build a Visualizer

#31
post #15

Do you guys remember the smalltalk toolkit posted here a while ago which their creators made specifically for help understanding new codebases?

https://gtoolkit.com/ or https://moosetechnology.org/

Woah, that Glamorous Toolkit environment looks amazing. Thanks for the pointer.

Re: Untapped Way to Learn a Codebase: Build a Visualizer

#32
Very cool! For all its faults, seeing control and value change flows through execution is one of the things I really liked about Unreal's Blueprint viz scripting system. This looks like a better take on that.

And for huge git repos I always like to generate a Gource animation to understand how the repo grew, when big rearrangements and refactors happened, what the most active parts of the codebase are, etc.

Re: Untapped Way to Learn a Codebase: Build a Visualizer

#34
Doesn’t anyone use debuggers anymore?

When I have a codebase I dont know or didn’t touch in some time and there’s a bug, first step is reproduce it an then set a breakpoint early on somewhere, crab some coffee and spend some time to step through it looking at state until I know what’s happening and from there its usually kind of obvious.

Why would one need a graph view to learn a codebase when you can just slap a red dot next to the route and step a few times?

Re: Untapped Way to Learn a Codebase: Build a Visualizer

#35

- But I'll admit, this isn't precisely how I would do it today How would you do it today?

I try to explain what I mean the next few sentences of the post. I have spent a good amount of my career jumping into fairly large code bases. I don't need to take it quite so step by step. I have seen enough code to take shortcuts, to guess at what is there.

But telling people that isn't helpful. I try at the beginning to give more step by step of how I would get into understand the code base if I didn't already know these kinds of shortcuts. (I'm not sure I could write those down, they are just know how and heuristics, like how when you are a starting to code a missing ; can take a much longer time to see than as you've been programming for a while)

Re: Untapped Way to Learn a Codebase: Build a Visualizer

#37
post #12
post #8

I always thought to do this visualization in 3d and maybe with VR. Not sure how useful or pleasing experience it would be. Kudos to the author of the project to get this done!

I got Minority Report vibes. This kind of approach might be what (finally) unlocks visual programming? I feel like most good programmers are like good chess players. They don't need to see the board (code). But for inputting the code transformation into the system this might be a good programmer's chessboard. Though to make it work concretely for arbitrary codebases I feel like a coding agent behind the scenes is 100…

A 3d environment (VR-headset with Tom Cruise-style-swiping, or Doom-style with WASD navigation) would be cool, one could be "in orbit", observing the system, watching the nodes and their interactions, and pause and see what messages they're passing to each other. How about time-travel-debugging to allow rewinds too!

As a bonus, porting Doom to it should be "trivial".

Re: Untapped Way to Learn a Codebase: Build a Visualizer

#38
The unit test approach from the contractor in the thread is gold: "find a recently closed issue and try to write a unit test for it." This forces you to understand the test infrastructure, the module boundaries, and the actual behavior — not just the code structure.

I'd add one more technique that's worked well for me: trace a single request from HTTP endpoint to database and back. In a FastAPI app, that means starting at the route handler, following the dependency injection chain, seeing how the ORM/query layer works, and understanding the response serialization. You touch every layer of the stack by following one real path instead of trying to understand the whole codebase at once.

Visualizers are nice for the "big picture" but they rarely help you understand why the code works the way it does. The why is in the git history and the closed issues, not in a dependency graph.

Re: Untapped Way to Learn a Codebase: Build a Visualizer

#39
Warning Blatant Self Promotion

I created Intraview for VS Code, Cursor, etc., that makes it easy to create code tours with your Coding agent by simply saying, "Create a tour that helps me understand how to get started with this repository."

It has other features, but it was designed for the problem of getting in new code bases and it allows the tours to be saved in the repo as flat json files. You can re-open or share tours with new folks, and if the code changes the system notifies you how to ask your agent to update the tour.

Just a thought.

Re: Untapped Way to Learn a Codebase: Build a Visualizer

#40

Doesn’t anyone use debuggers anymore? When I have a codebase I dont know or didn’t touch in some time and there’s a bug, first step is reproduce it an then set a breakpoint early on somewhere, crab some coffee and spend some time to step through it looking at state until I know what’s happening and from there its usually kind of obvious. Why would one need a graph view to learn a codebase when you can just slap a red…

I have found that interactive visualizations are a great way to understand code and systems in general. Now you can have an AI make one in under a minute it's a very useful tool.

https://heyes-jones.com/externalsort/treeofwinners.html

Take this example. I can step through the algorithm, view the data structure and see a narration of each step.

A debugger is useful for debugging edge cases but it is very difficult to learn a complex system by stepping through it.

Post reply on HN