updateObject or changeObject, removeObject or deleteObject?

52 views Asked by At

I'm off starting another project and I'm creating functions to add, update and remove objects.

I tend to doubt myself when it comes to naming the update and remove function, because sometimes i name them:

updateObject and removeObject 

but when i'm in a different mood on a different project i go for:

changeObject and deleteObject

Is there a naming convention in Java for these crud functions or should i go how i feel when i start a new project?

2

There are 2 answers

0
Luke On BEST ANSWER

The point of conventions are to make code consistent and understandable. Whether you call the methods removeObject, deleteObject, or whatever, they're still going to be very recognizable to anyone reading your code. That being said, I would agree that update and remove are probably more common than the alternatives.

0
Karrde On

add, update, remove is generally more prevalent, but as long as you're consistent I don't think it matters.