4 ms·
Not to diminish the effort, but the use case for this can only be a role that requires a ton of snippet handling, which inherently means you are doing somethin
by proc0 7y ago
Not to diminish the effort, but the use case for this can only be a role that requires a ton of snippet handling, which inherently means you are doing something wrong as a programmer (imho). Once you get to a point where you are regularly using snippets a lot, writing some automated script is the next step, not a tool that makes it easier to copy/paste.
- onion2k 7y agoWhat would the "automated script" do? My use case for snippets is mainly to stub out tests, components, and stories - things that are largely an exercise in boilerplate code with fill-in-the-blanks changes to start with. I can't think of a way to do that with a script that would be less effort than a snippet.
- proc0 7y agoI may be missing some key use cases, but presumably you would somehow use the same snippet again and again otherwise why have it in some tool, ready to go. Once you are using that snippet a lot, then I think the incentive to make it part of the running script is high, or even creating a new repo to track those snippets and then link that somehow.
- penagwin 7y agoSnippets for me are things I find that I google and copy+paste from stackoverflow semi-frequently. See the example here, it prints the currently loaded settings in Django. I don't use it super frequently (say a few times a month, depending on what I'm doing), but it's faster for me to find with a snippet manager then copying from the same stack overflow answer. > python manage.py diffsettings --all
- tiredyam 7y agojust make an alias :o
- penagwin 7y agoI frequently have to run this command inside a VM or a docker container, so I can't really use an alias for it.
- JacksCracked 7y agoUse a keyboard macro tool
- ktm5j 7y agoOr you work with a lot of different languages and you can only keep so many bits of syntax particulars in your head.
- gitgud 7y agoThis was my initial reaction too. Ideally popular code snippets should be published in a library or tool, which can be versioned and distributed easily... But in reality the overhead of creating and maintaining a library/tool/package can be enormous, for relatively small gains in re-usability (see: https://xkcd.com/1205/ https://xkcd.com/1205/). This snippet library seems more like a step before creating a library, kind of like note taking apps are a step before blog posts or publications. I think you could still use this and be a good programmer.
- aspaceman 7y agoI've got a lot of things like this in C and C++ for debugging. Like how to make a macro print a macro, or stuff like that.