Live data from Hacker News

Ask HN: Does anyone still use code snippets?

news.ycombinator.com

1–10 of 61 posts

Ask HN: Does anyone still use code snippets?

#1
Does anyone of you still use code snippets where you can type a shortcut and if you accept, it completes e.g. „fun“ to a function stub or has that all been replaced with AI-based completion tools like Copilot?

I noticed that I still like them and rely on them and was wondering if that’s the same for someone else.

Re: Ask HN: Does anyone still use code snippets?

#2
Huh... well, now that you mention it I realize my most common "type bit and have it expand" snippets are ones I made for certain temporary stacktrace/debug statements. I guess as a project matures you spend more time debugging or modifying what's already there. Even when those modifications are something the IDE helps with, that process is often triggered differently, highlighting existing text and using a refactoring menu/shortcut.

When I am working on new stuff... Well, my typing is mostly on autopilot, I use the time to think about what I'm going to put next, or else I've reached a spot where I would be making decisions anyway, e.g. naming a method.

Re: Ask HN: Does anyone still use code snippets?

#3
I’ve set a couple up for more custom things that Copilot won’t have, but tend to forget about them and end up just grabbing the code from another file or readme files I previously wrote.

I think a lot of the standard snippets from years past were already taken over by things like IntelliSense, or various other IDE plugins.

Re: Ask HN: Does anyone still use code snippets?

#6
I have a snippet I religiously use to scaffold the go error log + return. I’d say the amount of snippets I use are less, and maybe eventually I will use none. But with that one I want predictability. I don’t want to have to review every error statement as I build.
Post reply on HN