There is often a function I have to write that checks to see if something exists and creates it otherwise. I often struggle to name this and go with something like `addIfMissing`. Is there a common name for this? It happens all over programming. I've seen `ensure` used, which I don't really like.
Today, I wrote one that I named `stockToggle`. I like "stock", which implies that it will ensure a stock of something. Of course, if you don't read it as a verb (and in my case, read Toggle as verb instead of a noun), then it could be confusing. You might think it will toggle stock buying on or something.
Still, it's my best name for this kind of thing yet.