5

As a dev, I have to reuse a lot of codes again and again. Some I've written, and some of them I found after stucking my head for 1 hour on StackOverflow.

Now, the problem is every time I need the code, I have to search again. Some of them I saved in note apps but organizing code snippets & finding them with a quick search is a mess.

I was thinking of building a code snippet organizer where developers can save code snippets in any language (have syntax highlighting), search quickly, share with anyone, create buckets, manage multiple accounts etc.

Let me know if it's a good idea or not. Would you be interested in using something like this? Is this even a real problem or it's just me?

Comments
  • 1
    I "solved" this in a rather unconventional way a while back - I tend to both ask, and answer a Stackoverflow question (the same one, you have an option to post an answer when you post a question.)

    It usually gets ignored (absolutely fine), but the SEO on the site means that when I'm searching for the same issue again, my question, and corresponding answer with helpful code snippet, tends to pop right up.

    Granted this only works because I've been in the area long enough that the sort of things I get stuck with are pretty esoteric. If you did that for "how do I declare a string in Python" it'd probably just get closed and deleted.
  • 1
    I've actually thought about doing exactly this, but using notion. Plz tag me in a collab if you get around to it :)
  • 1
    Copy pasting code snippets here and there sounds like a great idea. If it's twice or three times, sure. But if you copy the same bits of code often enough that you need a tool for organising them, it sounds like you're solving the wrong problem.
  • 2
    @electrineer I'm thinking on things like a set of commands to configure something in Linux or other things that are not just snippets
  • 0
    @ScriptCoded that sounds like a script, no?
  • 1
    Classic
  • 1
    It's a real problem I face it a lot..

    I'd be interested in not just using but also contributing to development of the software
  • 4
    Git repo with function based self reliant classes/files
  • 0
    If you're okay with having it integrated into your web browser: try Grepper. Personally I'm very happy with it.

    It's exactly what you describe and best of all: it shows relevant code snippets right under your search bar when trying to search for an issue online (or go to your profile and look at all of them). The required "pattern" to match can be customizer btw.

    You can also quickly add code snippets present in web pages and refer sites as sources.

    And it also shows other's snippets if relevant, so crowd-sourcing is also present :)
    Be aware that they're always open for everyone to see.
  • 0
    @gymmerDeveloper for actual templating/fully functional code snippets I like to do this as well. Especially when it's something out of the box that you might have use for across projects.
  • 1
    @Bibbit easiest. Searchable. And can be made public too
  • 0
    @gymmerDeveloper and best of all: if they pull the plug, you can transfer it 1-on-1 to a different/local host! :)

    If someone made something like Grepper but then as a wrapper for your own local/github repo content I'd most likely switch immediately...
  • 0
    I'm sure I've seen tools like this a few times but I forgot what they're called or whether they still exist.
  • 1
    @Bibbit I work for a company where we build the same types of dashboards for our clients. As a result, we have to save snippets, functions, meta tags, and other bunch of things.

    What we do now, is we go to our GitHub repo, search for the code or send the code snippets by WhatsApp, Slack etc.

    I'm building a platform where developers can write & save a collection of code once & reuse it everywhere. Quick search, copy, paste.

    Can integrate with VS code as well, and will work something like a quick reply on chat apps.

    Teachers can share code snippets or collections of codes in different languages with their students.

    Companies can build a massive database of reusable codes over time which will save a lot of time.
  • 0
Add Comment