I was trying to explain something to a junior programmer the other day, and as part of it I had to explain that:
- a method with 'find' as the verb in it, will either find an item and return it, or return null.
- a method with 'get' as the verb in it, will either return an item, or throw an exception if it is unavailable.
Those two things are standard in PHP and other programming languages.
This made me realise that there are quite a few 'standard behaviours' associated with certain verbs, that would be difficult for people to learn about.
Is there a list any where of standard verbs to use, with the standard behaviour they should have, that would avoid confusion in assumptions?
Another example is that a junior programmer might use the verb 'make' in a method named makeHttpRequest
to indicate that a HTTP request will be performed. But for me 'make' is ambiguous, and often means 'create'. So for this one, execute
or dispatch
would probably be more standard.