6 ms·
Thank you so much! I sincerely appreciate it! > minimum viable code snippets When I read documentation, I love when there are a few snippets I can read, copy-
by zerojames 3y ago
Thank you so much! I sincerely appreciate it!
> minimum viable code snippets
When I read documentation, I love when there are a few snippets I can read, copy-paste, and adapt to work with my code, particularly when a library is vast. Google does a good job of this, for example. In some of the cloud code snippets, you can copy-paste and they _just work_ (after you have authenticated).
> e.g. without imports, so you can't just run it as is.
I think it only makes sense to omit imports when a guide is walking through a single file (i.e. step-by-step), or future code snippets are a continuation of existing code. I also love it when guides specifically call out what package(s) I need to install.
- starkparker 3y agoFull context also makes the snippets easier to integrate into automated tests, which should be a requirement for examples in supported software.