DEV Community

Discussion on: Code snippets or nah?

Collapse
 
alainvanhout profile image
Alain Van Hout

It’s rather important to note that different people here understand ‘snippets’ as being (two) different things:

  1. Non-minimal chuncks of code that you insert
  2. Minimal language constructs (e.g. a for-loop) that is autocompleted by your IDE

The first is akin to grabbing stuff from stackoverflow: chances are it might generally address part of your issue, but it won’t be a perfect fit for it. For most business code, the matter at hand tends to be far too specific for copy-pasting to be well-suited.

The second is simply a time-saver and typo-preventer: it doesn’t solve your issues, it just allows you to write code with less effort and less chance for stupid errors. (That is, a definite plus)

Collapse
 
andrewchou profile image
Andrew Chou

Yeah I think I was referring more to the latter to be honest, but you make a good point!