we dont use AI at my work
Ask HN: Does anyone still use code snippets?
21–30 of 61 posts
Re: Ask HN: Does anyone still use code snippets?
#22No snippets, no LLMs, no autocomplete.
I don't autocomplete everything, as picking things from a list is if not slower then at least more annoying than just typing that thing, but for common things it's helpful. For instance I type "game.ReplicatedStorage" all the time, so taking a few moments to learn that "game.reso" is the same has saved time.
What upped my motivation to learned some shortcuts was switching from one keyboard layout to another (qwerty->colemak) and having 20-30 WPM for a week. Typing everything was so painful that I could doubly appreciate it.
Re: Ask HN: Does anyone still use code snippets?
#23I tried using Copilot a bit, but I found it tried to do too much. As often as it got things right it got them irritatingly wrong. Something pared back giving context sensitive snippets would do fine.
Re: Ask HN: Does anyone still use code snippets?
#24Around 85% of the time, it seems like it takes me more time to write what I want to code in natural language to an AI prompt (and then correct it) than it would to actually code what I want.
The 15% of the time when I want something like "Write test cases to cover this module" is something a snippet couldn't do anyway.
Re: Ask HN: Does anyone still use code snippets?
#25Re: Ask HN: Does anyone still use code snippets?
#26- You can just type a CSS selector (actually a superset of CSS), then expand it into the analogous HTML.
- In VS code if you select some HTML then hit ALT-W, you can enter an Emmet snippet that surrounds that HTML.
Examples: https://docs.emmet.io/cheat-sheet/
Re: Ask HN: Does anyone still use code snippets?
#27Additionally, AI doesn't know how to produce the same output on each execution.
Re: Ask HN: Does anyone still use code snippets?
#28Re: Ask HN: Does anyone still use code snippets?
#29With AI, you never know what you'll get. OTOH snippets were created by hand by me. I know what to expect of them and what not to expect. They are always the same.
Re: Ask HN: Does anyone still use code snippets?
#301. When loading an empty file it inserts boiler-plate based on mode (largely that is based on the filename suffix). So if I open a buffer "t.pl" it will insert "#!/usr/bin/perl", along with "use strict; use warnings;", etc.
2. Completion for LSP-modes via yasnippet. So in golang mode I type "iferr[TAB]" and it expands into "if err != .." and moves my cursor to the proper spot when I type TAB.