Hacker News new | ask | show | jobs
by uticus 1152 days ago
This depends entirely on the language. An AST[0] can be derived from most any language, but how it is generated depends on the language's syntax.

An IDE (or IDE plugin) specific to the language is probably your best bet. Java has a huge ecosystem, so I would be surprised if nothing exists.

Also I would warn you that the results may not give you what you want. If the code was written such that it is impossible to tell what is going on without dropping into the details of every call, it is possible a diagram or graphic will not be as pretty as you expect.

Another option I've found useful when navigating is adding my own temporary comments in the code as signposts.

I would not discount pen & paper as a valid tool. Nothing wrong at all with jotting things down in a way that helps you understand someone else's code.

Lastly I would recommend remembering your struggles as you write code of your own, that someone else (or yourself) will have to slog through in the future.

[0] https://en.wikipedia.org/wiki/Abstract_syntax_tree

1 comments

Thank you. I would have thought some kind of code-aware design studio would be available, but can't find anything. So much legacy code has been written over the years and no help digging into it...