Ask HN: RapGenius for code?
I'm curious if this could be packaged as some github plugin that is language agnostic. Think of it as a persistent Q&A that holds a "conversation/discussion" on specific lines of code. Naturally, this feature is available when you send a PR to start a discussion, but once the PR is closed that's the end of the discussion. One problem code presents that other literature doesn't is the fact that it tends to be less static (i.e. code keeps changing over time whereas lyrics to a song may not.) If there were an elegant workaround to this problem (where prior versions of a line of code and its Q&A is cached so that an interested user could view what the past conversations were) I'm tempted to say that this could really streamline the learning and collaboration process when it comes to using/writing code.
Anyone here play around with this idea in the past? If so, I'd love to hear your stories. If not, anybody interested in joining me on hacking some POC up to see what this could end up looking like?
36 comments
[ 3.5 ms ] story [ 86.7 ms ] threadI like the idea for discussions, but does the discussion stay there? Would an individual line get bogged down in "stupid questions" that someone has to trawl through to find what they want? If it's on by default, would it just be annoying to those trying to read the code, and if it's off how many people would go out of their way to turn it on?
It's certainly interesting, anyway.
It's available if the person browsing the code is actually "interested" in looking at the conversations around a particular part of the code.
[1] https://en.wikipedia.org/wiki/Literate_programming#Example
https://github.com/OpenGrok/OpenGrok
I'm a student and often find myself struggling with pseudocode to the point that I end up writing it out by hand and annotating it in a similar fashion on paper.
For most code bases, the code is bound to evolve and change, so I wonder what the version reconciliation model would look like if there has to be constant syncing between what's on GitHub and what's hosted on genius (how would we capture multiple versions for example). Moreover, it appears that genius is great for annotating lines, but doesn't have the same Q&A feel that Omniref does[1]. I think what would be of real value is having the Q&A hosted "closest" to the codebase which is why I was thinking about a GitHub plugin. This in turn automatically has the ability to reconcile any old/deprecated questions that were relevant when the code was old.
[1] https://tctechcrunch2011.files.wordpress.com/2014/12/screen-...
At risk of being pedantic, it's "fu" as in "Kung fu", which loosely translates to English as something like "work and effort".
https://sourcegraph.com/github.com/golang/go@ac452349e4f40c3...
Because Sourcegraph understands the code at a semantic level, we can tie comments to a specific function/class/module and show the discussion history even as the specific lines of code change over time. Right now, we do comments for code reviews, but want to add this for any existing version of the code. I'm one of the creators of Sourcegraph and would love to hear any feedback/suggestions the HN community has to offer!
I love the fact that I can hover over anything (primtive, function etc) which surfaces a blurb on what its accomplishing .
>> Right now, we do comments for code reviews, but want to add this for any existing version of the code
Any idea on when you may roll such a feature out? I'd be hugely interested in using something like this for my team.
https://news.ycombinator.com/item?id=8821117
https://news.ycombinator.com/item?id=8821117
I dunno if I agree with that.
Check this out: http://genius.com/3410852/Genius-engineering-jobs-at-genius/...
For example: http://genius.com/5077469/gist.github.com/RogerPodacter/3e8a...
And actually you can put "genius.com/" in front of ANY url to annotate that page. For example: http://genius.com/5077492/www.paulgraham.com/yahoo.html
There's also a chrome extension: https://chrome.google.com/webstore/detail/genius-beta/ccaokn...
You can sign up for the beta at http://genius.com/beta.
(Questions / feedback welcome – tom@genius.com)
Regardless, this looks really exciting. I'm going to annotate a bunch of stuff just for funsies.
This annotation will always be on the version of active_model.rb at master, even if it changes.
And we try pretty hard to anchor annotations even when the underlying text changes. Here's a talk I did explaining our approach to "fuzzy annotation anchoring" if you're super interested: https://www.youtube.com/watch?v=FJyqfRcyYIQ
But it's definitely not perfect! Hit me up with suggestions: tom@genius.com
I think that says more about the weakness of mainstream diff tools than it says about the problem. I don't really know how difficult it is, but I'm guessing just a slight amount of semantic understanding would get you way beyond the quality of current diff tools. Kind of sad that nobody is doing it. I use Perforce every day on a really large, old code base, and it's depressing how awful the differ and "blame" tool are. Especially because those tools's usefulness seems to increase in proportion to the size and age of the code base. I guess programmers are masochists; we really haven't put that much effort into our own tools...
But in the real world, I think, the use case for annotations is when one group of people writes code, and another group of people annotates it because authors and collaborators can be opinionated, stubborn, lazy, or too busy, or there may be too much bureaucracy on the project, so it is much more realistic to just put annotations on some third-party website than to try to collaborate with the authors to add comments in the code or refactor it.