Is there an english word, which can be used for both update and create?
I'm programming a function which creates something if it doesn't exist already, otherwise it updates the stuff. A word which came me in mind is process. Does anyone know a better matching word for this purpose?
upsert
(a portmanteau ofupdate
andinsert
, the latter being the RDBMS analog to "create"). In the Unix family of OSes, the analog is the commandtouch
which either creates the named file (so obviously its timestamp is now), or causing an existing file of that name to have a timestamp of now. In general, you can name functions for what they output, because the client/caller doesn't have to care how you produced that result (i.e. whether you took an existing thing and modified it, or created a new one ex nihilio). – Dan Bron Apr 28 '15 at 11:57