5 ms·
Ask HN: RapGenius for code?
I think RapGenius (i.e. Genius) is a really powerful way to arrive at a crowdsourced understanding of what content is. This works well for static content like lyrics of a song, text in some literature etc. I got curious what something like this might look like for code and after a cursory google, I stumbled upon Omniref, which looks like they're targeting this exact problem. Of course, they're aiming to provide a very comprehensive solution that scours and indexes the web to surface code that can be annotated. AFAIK, their solution works for Ruby and more recently Javascript.
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?
- broodbucket 12y agoSomething like Google Docs comments hanging off the side of the document? It fits less for the Rap Genius example since the annotations explain the line, and in code if the line needs explaining then it should have a comment within the code itself. I 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.
- fizwhiz 12y agoThis is what I had in mind (lifted off of the techcrunch article on Omniref): https://tctechcrunch2011.files.wordpress.com/2014/12/screen-shot-2014-12-31-at-9-42-32-am.png?w=1360&h=452 https://tctechcrunch2011.files.wordpress.com/2014/12/screen-... It's available if the person browsing the code is actually "interested" in looking at the conversations around a particular part of the code.
- vezzy-fnord 12y agoSo this would be something like "Literate Programming as a Service", then?
- fizwhiz 12y agoI'd never heard of that before, but just checked it[1] out and it looks pretty cool. I guess the only distinction I'd make is for cases where people have a bunch of code already written out, and someone comes in and says "Hmm, why was this written like this?" and the original dev (or some other contributor) can respond with answers that have votes and the possibility of follow ups. Basically like an HN discussion board where the highest rated/popular answers are up top and each comment can have its own children. [1] https://en.wikipedia.org/wiki/Literate_programming#Example https://en.wikipedia.org/wiki/Literate_programming#Example
- steele 12y agoPartially related: https://en.wikipedia.org/wiki/Literate_programming https://en.wikipedia.org/wiki/Literate_programming https://fogus.github.io/marginalia/ https://fogus.github.io/marginalia/
- e12e 12y agoAnd partially related to the task of understanding/navigating a code-base: https://github.com/OpenGrok/OpenGrok https://github.com/OpenGrok/OpenGrok
- def_illiterate 12y agoThis would be an awesome pedagogical tool. 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.
- fizwhiz 12y agoI agree. Answer-hubs like stackoverflow have their own place, as do Git discussions for PR's. But I'm tempted to say that there's a gap for more effective collaboration in the "in-between parts" you know, where some new contributor takes a look at the codebase and says "Huh, why is this written like this?". Instead of chat/email, the entire conversation history can be preserved adjacent to the codebase itself without being intrusive.
- striking 12y agoGenius already does code: http://genius.com/James-somers-using-diff-match-patch-to-capture-revision-history-annotated http://genius.com/James-somers-using-diff-match-patch-to-cap...
- fizwhiz 12y agoI wasn't able to locate an example (weak google foo i guess), so thanks for providing it. My only mild gripe with this is that the "code" is actually "static" on which the comments are being applied. 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-shot-2014-12-31-at-9-42-32-am.png?w=1360&h=452 https://tctechcrunch2011.files.wordpress.com/2014/12/screen-...
- allannienhuis 12y agoThere are a lot of code review tools that might be suitably repurposed for this sort of thing. Lots of quality/community issue I expect though.
- misiti3780 12y agoI think it is a good idea - one piece of advice, do not make your UI black :)
- tonyhb 12y agoThink the chaps at Sourcegraph are already on it. Here's an example: https://sourcegraph.com/github.com/golang/go@ac452349e4f40c30d50f9922bf2c4592e748ce5e/.tree/src/bytes/bytes.go#selected=3 https://sourcegraph.com/github.com/golang/go@ac452349e4f40c3...
- beliu 12y agoCheck out Sourcegraph: https://sourcegraph.com https://sourcegraph.com. It semantically analyzes code, makes it searchable, and lets you find usage examples of how others use it. One of the features we're planning to ship soon is commenting on pieces of code. 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!
- fizwhiz 12y agoHey, sourcegraph looks really neat! Another commenter provided the following example: https://sourcegraph.com/github.com/golang/go@ac452349e4f40c30d50f9922bf2c4592e748ce5e/.tree/src/bytes/bytes.go#selected=3 https://sourcegraph.com/github.com/golang/go@ac452349e4f40c3... 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.
- beliu 12y agoWe're shooting for sometime soon; it's high on our priorities list, and we'd love to find partners to help test out the feature. Want to shoot me an email at beyang@sourcegraph.com?
- spellboots 12y ago"Omniref (YC W15) Is Rap Genius for Code": https://news.ycombinator.com/item?id=8821117 https://news.ycombinator.com/item?id=8821117
- spellboots 12y ago"Omniref (YC W15) Is Rap Genius for Code": https://news.ycombinator.com/item?id=8821117 https://news.ycombinator.com/item?id=8821117
- _RPM 12y agoI have an opinionated statement about RapGenius: they're a bunch of idiots. Did you see them at that Techcrunch event? Seriously watch it and tell me what you think about them.
- perdunov 12y agoEven if they were idiots, so what? There is no proof that idiots can't be successful in business.
- asadlionpk 12y agoI would agree with you but Genius is actually a pretty great idea! So it doesn't matter.
- diminoten 12y ago> I think RapGenius (i.e. Genius) is a really powerful way to arrive at a crowdsourced understanding of what content is. I dunno if I agree with that.
- simplyluke 12y agoSo I reached out to them about this a few months back - some of their engineers have pitched it and done it internally. Check this out: http://genius.com/3410852/Genius-engineering-jobs-at-genius/Introducing-code-genius http://genius.com/3410852/Genius-engineering-jobs-at-genius/...
- tomlemon 12y agoYou can annotate code with the new Genius beta! For example: http://genius.com/5077469/gist.github.com/RogerPodacter/3e8adbfa9cfd06d239a2 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 http://genius.com/5077492/www.paulgraham.com/yahoo.html There's also a chrome extension: https://chrome.google.com/webstore/detail/genius-beta/ccaokncpmmjiakalbcfdbfmpcaiddjdn?hl=en-US https://chrome.google.com/webstore/detail/genius-beta/ccaokn... You can sign up for the beta at http://genius.com/beta http://genius.com/beta. (Questions / feedback welcome – tom@genius.com)
- fizwhiz 12y agoHot damn that's badass. Just signed up for the beta. It's a shame that I work for a big corp with code behind the company firewall so prefixing a code repo link like httpS://github.bigcorp.com/code-repo/funstuff.py with "genius.com/" resolves to a 404. Regardless, this looks really exciting. I'm going to annotate a bunch of stuff just for funsies.
- asadlionpk 12y agoBut that code is just a html page you are annotating. What happens on a new commit. The annotations should persist somehow across code changes. That would require specialised solution for code annotation I suppose.
- tomlemon 12y agoWell take this for example: http://genius.com/5079163/github.com/rails/rails/blob/master/activemodel/lib/active_model.rb http://genius.com/5079163/github.com/rails/rails/blob/master... 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 https://www.youtube.com/watch?v=FJyqfRcyYIQ But it's definitely not perfect! Hit me up with suggestions: tom@genius.com
- 12y ago
- deleted 12y ago[deleted]
- perdunov 12y agoIn an ideal world, this would be pointless because if the code requires "annotations", it should be rewritten, or annotations may be just a specific kind of comments in the code itself rendered in a specific way. 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.
- psm42 12y agoHow about https://notedcode.com https://notedcode.com
- kbpowell03 12y agoi don't wana;turn.to look at yo face.man look atchyo mama man look at the phaze. by:kole
- DwayneSamuels 12y agoStackOverflow?