News for hackers. Stuff that matters.
Re:Show HN: MassCode – a code snippets manager for developers by proc0 on Monday December 30, 2019 @04:50PM (#21917003)
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.
Re:Show HN: MassCode – a code snippets manager for developers by penagwin on Monday December 30, 2019 @05:24PM (#21917227)
Snippets 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

Re:Show HN: MassCode – a code snippets manager for developers by tiredyam on Monday December 30, 2019 @10:48PM (#21918797)
just make an alias :o
Re:Show HN: MassCode – a code snippets manager for developers by penagwin on Tuesday December 31, 2019 @10:47AM (#21921758)
I frequently have to run this command inside a VM or a docker container, so I can't really use an alias for it.
Re:Show HN: MassCode – a code snippets manager for developers by ktm5j on Tuesday December 31, 2019 @12:01AM (#21919081)
Or you work with a lot of different languages and you can only keep so many bits of syntax particulars in your head.
Re:Show HN: MassCode – a code snippets manager for developers by onion2k on Monday December 30, 2019 @05:08PM (#21917109)
What 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.

Re:Show HN: MassCode – a code snippets manager for developers by proc0 on Tuesday December 31, 2019 @11:22AM (#21922124)
I 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.
Re:Show HN: MassCode – a code snippets manager for developers by aspaceman on Tuesday December 31, 2019 @05:22AM (#21920063)
I'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.
Re:Show HN: MassCode – a code snippets manager for developers by gitgud on Tuesday December 31, 2019 @12:54AM (#21919242)
This 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/).

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.