Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Semantic differences between save/write/store and read/load?

Tags:

save

store

load

I never know what is the correct name for a function that writes/stores/saves something in a file. When should I use save() vs store() vs write() and what is the difference in meaning between those?

I guess storeis used if I write to a database, writefor text files and savefor binary data, is that correct? What about XML files?

like image 605
Konrad Höffner Avatar asked Aug 23 '12 09:08

Konrad Höffner


People also ask

What is the difference between save and load?

Load definition imports a new resource into a project while Save definition saves it for export to another system. For example you may want to reuse an activity or data source which has already been defined for a different task.

What is the difference between saving and storing?

They mean the same :) but save is used more when talking about money or time. Store is more to put something away for a while. But save is used more commonly to keep something safe.


2 Answers

Well, it is up to you. I personally use saveXXX() and loadXXX() for most of such code and it's quite not important how the data is saved technically (file, DB etc). From application point of view it makes no difference. Code that saves just needs data to put it in the storage, more or less persistent, and it does not really bother how it is done by the storage layer. I simply suggest to stick to one naming, basically for sake of simplicity and consistency.

like image 138
Marcin Orlowski Avatar answered Sep 18 '22 11:09

Marcin Orlowski


I use load / save for methods that implicitly know or infer where to get or put the data, whereas read and write methods explicitly need to be told so. I guess that in the end it's completely arbitrary, but a community consensus on when to use which word would be nice to know.

like image 25
grg rsr Avatar answered Sep 18 '22 11:09

grg rsr