Hacker News
Untapped Way to Learn a Codebase: Build a Visualizer
tclancy
|next
[-]
its-kostya
|next
|previous
[-]
criddell
|next
|previous
[-]
https://en.wikipedia.org/wiki/Doxygen#/media/File:Doxygen-1....
cyberpunk
|next
|previous
[-]
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?
catapart
|next
|previous
[-]
I built my own node graph utility to do this for my code, after using Unreal's blueprints for the first time. Once it clicked for me that the two are different views of the same codebase, I was in love. It's so much easier for me to reason about node graphs, and so much easier for me to write code as plain text (with an IDE/language server). I share your wish that there were a more general utility for it, so I could use it for languages other than js/ts.
Anyway, great job on this!
glaslong
|next
|previous
[-]
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.
FailMore
|next
|previous
[-]
Charon77
|next
|previous
[-]
hks0
|next
|previous
[-]
avaer
|root
|parent
[-]
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% required.
netsharc
|root
|parent
|next
[-]
As a bonus, porting Doom to it should be "trivial".
mathgeek
|root
|parent
|previous
[-]
A specific type or area of developers, I'd say. There are many types and not all of them require understanding sizeable code bases to do their work well.
soulofmischief
|root
|parent
[-]
Done right, you may not know specific lines or chunks of code by heart, but much like a tuned-in company CEO, you have eyes and ears on the ground and retain global oversight and insight of the project itself. For specifics, you can learn what you need as you need it. If that means knowing how every single module works, that's just a conversation with your agent.
Quiark
|next
|previous
[-]
jnpnj
|next
|previous
[-]
luxurytent
|next
|previous
[-]
esafak
|next
|previous
[-]
esafak
|root
|parent
[-]
Think of an on-caller who wants to quickly pinpoint a problem. Visualization could help one understand the nature of the problem before reading the code. Then you could select a part of the visualization and ask the computer to tell you what that part does, if there are any recent changes to it, etc.
satheeshds
|next
|previous
[-]
How would you do it today?
jimmyhmiller
|root
|parent
|next
[-]
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)