Live data from Hacker News

The impact of file position on code review

arxiv.org

1–10 of 38 posts

Re: The impact of file position on code review

#4
Heh, I've had certain modules where I ended up prefixing the files with `a_initialization.lang` `b_startup.lang` `c_run_the_thing.lang` [...] to make it easier to read for humans. Just like, in, say, a book, where the chapters appear in a specific order, the order of things matters! Probably this is a literate programming sort of thing?

Re: The impact of file position on code review

#9
I've recently started using Github code reviews for a lot of C++, and one thing that I wish it would do is show the header (.h) files before the implementation (.cc) files.

Small PRs help, but I often end up just opening a handful of windows to have everything open at once.

Re: The impact of file position on code review

#10

I've recently started using Github code reviews for a lot of C++, and one thing that I wish it would do is show the header (.h) files before the implementation (.cc) files. Small PRs help, but I often end up just opening a handful of windows to have everything open at once.

You can't do that in github as far as I know, but you can get git to display diffs that way (eg. for local review or email based workflows). You have to use a git "orderfile". Example:

https://gitlab.com/nbdkit/nbdkit/-/blob/master/scripts/git.o...

We found it useful to display header files, interface files and documentation first, but maybe the linked paper will make us review that!

Post reply on HN