The recent discussion on package registration waiting periods and the merit of one-function packages got me thinking. I think stackoverflow shows that there is a demand for simple functions that solve problems that are quick to solve if you know how but can be tricky if you don’t. Or if you simply wish to not waste time on coming up with a solution and would like to copy-paste something that has been tested by someone else.
People don’t bother setting up packages for such functions in almost all cases, and it’s probably good that they don’t. But copy-pasting a random snippet off stackoverflow can be frustrating if it has been written for a previous version of Julia, or just doesn’t work quite right.
Here’s my idea: Set up a generic cookbook package or just a repo that everybody is free to PR to. This would not be intended as a dependency but as a collection of useful snippets. Submissions would have to adhere to certain constraints to keep them simple and copy-pasteable. Maybe just functions and macros but no types, for example. Things that work without any dependencies. Each function would have to have a clear docstring and a couple of tests. Maybe even a simple benchmark. All this could be automatically compiled with Documenter into a nice website.
The minor version would grow with each modification so people could refer to the version that they copied. This way, we could grow a higher-quality collection of helper functions that don’t merit dependencies but can still be trusted to work with some confidence. I think this could be quite valuable to have. I certainly have often wished to have something between github gists and a full package. Something with tests to show if it still works years later.
What do you think?