DEV Community

Discussion on: What are your snippets?

Collapse
 
dmfay profile image
Dian Fay • Edited

I'm in the "snippets are a symptom of poor organization" camp. If they're big, they should be dependencies; if they're small, it adds about as much cognitive load to remember that they exist and how to apply them as it does to type whatever it is out from scratch.

Collapse
 
codevault profile image
Sergiu Mureşan

Do you work on backend or frontend?

Collapse
 
dmfay profile image
Dian Fay

Both, although my preference is very much for backend and infrastructure.

Thread Thread
 
codevault profile image
Sergiu Mureşan

In my opinion snippets are very useful in frontend where you have a lot of HTML accompanied by some boilerplate JavaScript.

But for backend I find very rare occasions to use them. Only when I create new REST calls or implement some fairly boilerplate code that talks to the database we need such things... although that is a limitation of the technologies we use.

Maybe frontend will get there at one point in terms of redundant code but for now, snippets are a decent alternative.