@
@
@xpostman2011-01-26 18:36:52
Programming
@xpostman, 2011-01-26 18:36:52

Variable naming: "removeSmth" vs "deleteSmth"?

I want the name of a certain object to most accurately correspond to the essence. I recently noticed for myself that I don’t see the difference between the words remove and delete and use any. Is there any semantic difference between these two words? Are there situations in which one word is better suited than another? Is there an analogy here, for example, with the words "find" and "search"?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
X
XaBoK, 2011-01-26
@XaBoK

- I'm interested in "Remove Smith" or "Erase Smith"?
— Is it all the same, Mr. Anderson?

A
agul, 2011-01-26
@agul

There is no global difference, both words mean "delete". But “remove” has an alternative translation “remove”, “remove” and in fact has a softer meaning than “delete” - “erase”, “delete”, “exclude”.
Well, remove is a more formal word.

M
maseeq, 2011-01-26
@maseeq

Well, I see find as a search with a positive result known in advance, and search is the search process itself, which may not lead to a result. As for remove and delete, here I see in the first case the elimination of an object, despite the fact that this object can be called again, and delete is the removal of an object without the possibility of calling it again.
This is me from the point of view of linguistics and experience, coders may not agree with me.

A
Alexander Keith, 2011-01-26
@tenbits

Most likely you meant method names.
remove - removal from lists, deleta - removal of whole objects. I would also like to take this opportunity to say that in some cases it is convenient to call SmthRemove || SmthDelete (although not accepted).

P
Parsing, 2011-01-27
@Parsing

delete - destroy
find - seek

M
mikhanoid, 2011-01-27
@mikhanoid

IMHO, in general, if we look at the bindings of English words to English, and Russian to Russian, we will see the difference. To remove is not to destroy, not to liberate, not to destroy. In Russian, to remove is to remove, to move far away. Remove, in principle, corresponds a little to the word delete. Because there are such terms as removable media, or something else. But there is no shade here: a destructible carrier. It is precisely removed, taken out all that.
So, remove and remove is something like 'get out of sight'. Therefore, as if the rm command in UNIX is not deleting a file, but deleting a link to it from a directory, like - I don’t want to see you.
Delete is different. This is kind of the opposite of let. And it just makes sense: to destroy what has arisen, or to erase it from the board, to delete it from the text. All that.
Again, find and search, they also do not translate as search, if you look for semantic bindings in English. search is something related to study, because research, or there is a scientific search, or a search for a solution. This is something that continues, not necessarily with the desired result. And find (the second meaning is to found) is something that is associated with obtaining a result, with gaining something like that.
Here. You can apply this to programs. My experience: I don't use remove and delete. I use these expressions: form and drop. The first one is to form, which is more relevant in meaning to creating an object in memory, and drop is to throw it away, it’s also quite understandable, without any subtleties, and it’s more in line with the meaning. When we get rid of an object in a program, we do not erase it, we do not destroy the memory in which it is located, we kind of just forget about it, we throw away the link. Yes, and write shorter and smoother:)
formSmth
dropSmth
Well. Both in programs and in my data structures, I always do find in data structures, and search is more like a noun and an adjective when you need to name something search: searchbot or there linesearch (in image recognition).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question