While the same approach (i. e.) with view module as argument in Phoenix.View is not? Yes, I know it has been documented as being deprecated good time ago. I am asking about the reason for doing it in the first place and creating such difference/inconsistency on the way.
The issue where the deprecation message was introduced has some discussion:
Thanks for the link. There’s:
I think our clauses were laid out in a way where you could pass a template where a view was expected or vice-versa because we were matching on the type and that can be a security issue if people are not careful. I mean, people would have to already be doing something wrong, but better to be safer and keep the API simple.
which (I think) tries to give an answer to the question, although I am afraid I don’t understand it properly enough to find it cogent. Not that it’s a major issue or so. Just, unless there’s an important reason for it, it feels like another tiny bit of unnecessary friction. It might only be me, but I tend to also value consistency, not only simplicity And potential security aspects could most probably be addressed without API changes.
Anyway, reworked all my calls to “render/4 with a view” in controllers into two calls in order to silence the deprecation warnings, and noted mentally down “no, no, in controllers you’re not supposed to do the same as in views!”