component / model

Minimalistic extensible data models
122 stars 40 forks source link

added destroy as an alias #36

Closed ianstormtaylor closed 11 years ago

ianstormtaylor commented 11 years ago

I prefer destroy as it mirrors what Backbone calls it, and just feels more right than remove. I feel like having an alias is pretty low cost, and it's not going to ever be used for anything else since it would be too ambiguous.

ianstormtaylor commented 11 years ago

sorry, i realized this is not so simple. if people are calling it destroy as an action, they'd expect to bind to the destroy event as well, so in this case an alias is great. one or the other has to be chosen.

i personally think destroy is the better call, since remove implies removing from something but there isn't really a something. just like there's no model.add call, model.remove doesn't make sense either.

could be a name other than destroy though if TJ needs a word without y in it :p

what do you guys think?

tj commented 11 years ago

how did you know it was the y?!

tj commented 11 years ago

I like remove personally be because it's not as "harsh", if you're doing soft deletes on the backend etc, destroy is RAWR

ianstormtaylor commented 11 years ago

;)

tj commented 11 years ago

ohhh haha magic

ianstormtaylor commented 11 years ago

what kinds of things are you doing soft deletes for? (just dont know the use case) should the person using the model even know that the delete is "soft"?

semantically remove is an action that always needs a noun. you always remove something from something else, which is why it makes a lost of sense for collection or list or set. but for model its unclear

tj commented 11 years ago

yeah true, i'm down with .destroy I can think of anything better without the y

ianstormtaylor commented 11 years ago

ill PR later today

— ian storm taylor

On Friday, June 7, 2013 at 8:28 AM, TJ Holowaychuk wrote:

yeah true, i'm down with .destroy I can think of anything better without the y

— Reply to this email directly or view it on GitHub (https://github.com/component/model/pull/36#issuecomment-19114009).