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 store
is used if I write to a database, write
for text files and save
for binary data, is that correct? What about XML files?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With