Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming decision: "Create it if it doesn't exist" in one word

Tags:

naming

Exact duplicate of

  • Function name for creating something if it's not there yet

I have a function which checks if a certain thing exists, and if not, creates it. What would be a good word for it? Right now I'm using "maintain", so the function is called maintain_buffer_on_path, but I think that "maintain" is misleading. Can you think of a better one-word name?

like image 264
Ram Rachum Avatar asked Oct 16 '09 17:10

Ram Rachum


3 Answers

I usually use ensure for this.

like image 149
pgb Avatar answered Nov 01 '22 07:11

pgb


EnsureExists (or simpler Ensure) seems to be some kind of a convention.

like image 41
Konrad Rudolph Avatar answered Nov 01 '22 07:11

Konrad Rudolph


I've heard the word vivify to refer to this.

like image 29
Tim Avatar answered Nov 01 '22 06:11

Tim