Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Absolutely love:

  1. IDE plugin (Eclipse, Xcode + MSVS incoming)
  2. Community driven snippets
  3. Integrated into autocomplete
This approach is the trifecta of productivity for software developers.

I remember years ago finding some "overly smart" autocomplete hints from IntelliJ that surprised me, for example typing paths to files and having it automatically guess at the path given the execution context and that blew me away.

At some point all of those "try and be extra smart" rules fell out of favor and seemed to disappear and just get replaced by more robust/concrete type-inference inside the IDE. I understand why, trying to be TOO smart and getting it wrong is absolutely maddening and helps no one, but it was still nice to see.

These clippets remind me of a middle ground, where the tool is trying to be very smart, but also requiring you to fill in the part it can't concretely guess at (e.g. path variables in the demo video).

The other big win here is that since this is essentially search plus paramaterized clippets, there is no reason this cannot work for Python, Ruby, Go, JavaScript and anything else you would want.

The community aspects of building up the repo is just brilliant. Best of luck to this team, this looks like a hell of a nice job!



  4. version-controlled snippets so you can know if there are improvements / errors
add that, and we're golden. But stale copy/paste code is flat-out dangerous, and that's all this really is from a code standpoint, with a bit of magic and discovery. Not that I'm downplaying the tool - I think it looks really good. Just that using community-generated code is dangerous unless you either carefully curate it, or understand everything it does.


Copy/Paste as horrible I think is oversold.

I would never paste in a snippet of code from a bad programmer because the code would look ugly and wrong and it would be obvious.

So the risk is bad programmers copy/pasting from other bad programmers. Sounds like an argument against bad programmers, not copy/paste.

Not everything should be abstracted into a library. I think the example in their screencast is a good one.

Yes, if the snippet has a bug, you're copying that bug everywhere. But if it doesn't, it saves you from writing a potentially buggy implementation.

I believed for many years as a programmer the dogma against copy/paste. Now i use it, as I use any other tool, in a way that I find appropriate.


But what if the code looks beautiful and right, but hides a rare bug that the designer doesn't know about?

I totally agree, it's over-sold. But any time you're using something you don't fully understand, you run risks. Being able to be informed of updates / problems would change the entire practice of re-using snippets, and integration into an IDE is the perfect way to do so. You, as a contributor, could even learn of problems / improvements that others have found.


"But what if the code looks beautiful and right, but hides a rare bug that the designer doesn't know about?"

All I'm saying is, in my experience, developing systems and apps for 10 years, the "rare bug" you talk about is just not a big enough problem to warrant that kind of caution.

Because the kind of code that you put in a snippet and reuse is the kind of "glue" or boilerplate code that is a solved problem.


What do you think of the version of the code I posted at http://news.ycombinator.com/item?id=2904572? I originally wrote it in response to your comment, "Not everything should be abstracted into a library. I think the example in their screencast is a good one," but then I thought it might have wider interest.


Thanks, versioning is really important. By default, when you create a snippet, it only appears in your search results. There is an option to submit a snippet to be included in the shared results. We're building a moderation system to handle those submissions. In the meantime, we're manually approving submissions to the shared repository. The moderation system will include versioning.

We're also building a feature to allow users to define groups and share snippets with groups.


Good to hear :) How are you planning on tracking where snippets are used? I personally liked an idea I saw once of 'tagging' snippets with their Gist URL in a comment above the code, but it was a fatally-crippled idea because no IDEs supported such things transparently.

As much of a hell as it will be to add / maintain, can I also request that they have version + library dependencies listed somewhere, somehow, so you automagically get the most-correct one? I realize I'm asking for a package management system, and I have yet to see one that isn't fugly, but I can dream, can't I? At the very least, I figure language-version is a necessity due to syntax changes.


This is actually already partially implemented. If you insert a snippet that includes a method/class (e.g. search for "screenshot"), a comment uniquely identifying the snippet is included in the inserted code. We currently aren't inserting these comments for the smaller snippets because we thought it would be annoying (but we could implement an option to enable it). It would be pretty easy (once versioning is up and running) to notify programmers when newer versions of the identified snippets are available.


Very good point Groxx, my own experience with this was looking for some snippets recently and Google ended up directing me to DZone Snippets[1] for and what I found were snippets from Java 1.3 to do the task that in Java 6 had been completely reworked with some of the new APIs and language features.

So you have a very good point, for longevity, that the snippets need to be versioned.

[1] http://snippets.dzone.com/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: