Best Practice to Manage Utility Functions

It is often the case sometimes we write some functions that turns out to be handy and we would like to reuse them later. My current solution is to keep them in a single notebook and copy them to every project. Clearly this is bad for version control. I also thought about using package but every time you want to make some change you have to dig into the package folder and reload everything. I'd appreciate any idea on this, thanks.

• You can keep them in a notebook and use NotebookEvaluate[...path...] it's almost like using a package with a little less overhead, and slightly easier than copying the code. I use that for a few odds and ends I don't feel the need to write into a package. Though this is a practice, I think calling it "best practice" would be a stretch :) May 9, 2019 at 17:42
• What's any different between updating a package and updating a notebook? Having all your code in a centralized place is, as you say, better for VCS but you can also now use the code more easily by just calling Get. Best practice is definitely just making a package out of it. May 9, 2019 at 17:55
• You can use DefineResourceFunction and LocalObject to do this, although the exact incantation escapes me at the moment. Then you can do ResourceFunction["myfunc"] and use your function anywhere locally. May 9, 2019 at 17:55
• @b3m2a1 Indeed they are similar but when using package we are dealing with context scopes. A real life scenario is when we write some functions and realize it'll be useful in the future. At this stage the definition is already in the Global context so adding it to the package would result in conflicts. This is not a huge problem that can be easily resolved by clear the definition in Global context. May 9, 2019 at 19:37
• @L.Yu You can certainly do that. You don't actually need ResourceFunction for that - you can just use CloudPut and CloudGet. May 9, 2019 at 19:40