In my team, we work closely with a few software architects. They approve all design decisions of our projects, do some code reviews etc.
Our projects consist mainly of backend functionality implemented in PHP using the Symfony 2 framework. So syntactically, the code, naming conventions and project structure look almost identical to what Java would look like (Symfony 2 encourages such structure). I'm mentioning this because Java-specific conventions also apply in our case (if possible).
Recently, they suggested something that I find very strange: all methods should have conjunctions in their name e.g. getEntityOrNull
, setValueOrException
etc.
Such a naming convention feels very wrong to me, but I can't come up with any concrete arguments or online articles/pages that specifically challenge this.
The only things I came up with is:
- such information should be present in the method's annotations, like
@return
or@throws
- the use of conjunctions ("and", "or" etc.) in method names usually suggest that the Single Responsibility Principle is not properly respected
What are some other concrete arguments against this naming convention?