I’m 50/50 on this. I do like “explicit is better than implicit” for some things, but also “convention over configuration” in some points. I think there is a thin line between them which is where we should be comfortable. If we should respect “explicit is better than implicit” as a unbreakable rule, the resources/2 function shouldn’t even exist at all.
I agree with you, but for this particular change, I don’t believe that it affects or violates the convention over configuration philosophy.
As you said, there are some stuff that would greatly benefit from being somewhat implicit, but there are also stuff that would make phoenix easier to understand, especially for newcomers.
Actually, now that I think about it, it’s more of a “whitelisting vs blacklisting” issue rather than “explicit vs implicit”.
I would much rather know what routes I’m getting than what routes I’m not getting.
Again, I’m interested to see what the community thinks of this change. I’m glad and honored that Jose thinks it’s a good idea. @chrismccord@josevalim I’m more than happy to submit a PR if you and the community think it’s a “go”.
Well, that’s a good argument. But I particularly only use except when I have a simple case, which is easier explained like “a resource that cannot be deleted” than “a resource that can be listed, shown, created or updated”.
Anyways, for the JSON routes, I’m comfortable with any of the choices, only or except. I particularly use to save this options on a var to keep my router a little DRYer:
scope "/" do
pipe_through :api
opts = [except: [:new, :edit]]
resources :orgs, opts
resources :users, opts
end