Instantly share code, notes, and snippets.

Embed
What would you like to do?
A method-naming flow chart

because there's so much more than "get"

Is your method retrieving a record(s) from a data source? (e.g., a database or external service, or making a GET request)

get_*

Is your method creating a new record in a data source?

create_*

Is your method updating a record in a data source?

update_*

Is your method taking some data and changing how it looks? (but keeping it in the same object type)

format_*

Is your method taking some data and fitting it into a new data structure? (e.g., dict => namedtuple)

make_*
make_*_from_*

Is your method extracting some information from a set of resources? (e.g., "get all IDs from this list of user objects")

collect_*
collect_*_from_*

Is your method triggered by an event? (e.g., "when button X is clicked")

handle_*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment