Live data from Hacker News

Ask HN: Is there a tool you use just for reading code?

news.ycombinator.com

1–10 of 16 posts

Ask HN: Is there a tool you use just for reading code?

#1
When writing code, I'm a huge fan of using keyboard driven development. But sometimes I just want to read code, either to review or to learn things in a mouse-driven and read-only environment. Git forges seem like the obvious answer to this but they're slower to browse and not as customizable as your favorite text editor/IDE.

Is there an application you use to read code? And am I alone in feeling the need of such tool?

Re: Ask HN: Is there a tool you use just for reading code?

#2
Most of the times I use less in the terminal. Or vi, it's not easy to accidentally make a change and save it. Or the browser in GitHub, Bitbucket or what else hosts the project.

I write code with emacs. I could turn a file in read only mode but I prefer not to mix what I'm working on with what I'm only reading.

Re: Ask HN: Is there a tool you use just for reading code?

#5
If it’s a project I already have open in VS Code, I won’t use a separate tool.

If it’s a single file I want to check out, I have an alias for “nvim -R” which I use a lot. Vim’s syntax highlighting is very good, prevents me from making accidental changes, and is very convienent if I’m in the terminal already.

If I’m looking at code on GitHub then their code-search feature is very cool (cs.GitHub.com or by pressing cmd+shift+f on GitHub).

Re: Ask HN: Is there a tool you use just for reading code?

#7
see: https://github.com/CoatiSoftware/Sourcetrail , even tho the project is marked archived, it's pretty solid, i personally still use a 2019 release.

i also have a self hosted instance of this : https://elixir.bootlin.com/linux/latest/source

what you asked, comes across with code auditing as well, i wasn't surprised to know security researchers use sourcetrail as well.

hope your favourite language is supported.

Re: Ask HN: Is there a tool you use just for reading code?

#8
I do code review for legal cases on occasion. When I do, and when possible as sometimes the tools I can use are specified before I get the job, I like to use doxygen (https://www.doxygen.nl/) to convert the code to html. It also creates call graphs.

It is nice because it links to function and method definitions where it can, so as I go through the code I open each function I am teaching in a new tab - the open tab set simulates the call stack.

Re: Ask HN: Is there a tool you use just for reading code?

#9
Not quite what you're asking but once I've narrowed down a code base to the particular area of interest, I use an old school method for grokking:

Print the relevant sections off to read and use pen to mark and note against them; I find it extremely useful (and less tiring on the eyes) for linking functions and clarifying code.

Post reply on HN