naming convention

Naming convention: Find() versus Get()

  • me: Hey kid! Go find me some batteries
  • kid: But where are they?
  • me: That's why I told you to go find them. If I knew where they were, I would have told you to go get them. Or you could ask your mother.
Find
Will return NULL if object is not found.
Get
Will never return NULL but will throw exception if object is not found.

Reference: http://programmers.stackexchange.com/questions/182113/how-and-why-to-decide-between-naming-methods-with-get-and-find-prefixes

Subscribe to RSS - naming convention