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.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.
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.
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.
We're also building a feature to allow users to define groups and share snippets with groups.
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.
So you have a very good point, for longevity, that the snippets need to be versioned.
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!