if it’s called getPromotedPosts then it is probably fetching some information from somewhere—maybe the internet, maybe a database—and probably isn’t doing any computation to speak of;
if it’s called promotedPosts then it is probably either computing something or just using a value it already knows and can return quickly and easily.
I am not sure there’s any function name that would be perfectly neutral between (1) extremely cheap operation, probably just returning something already known, (2) nontrivial calculation, and (3) nontrivial fetching.
There’s also a bit of ambiguity about whether something called getPromotedPosts is fetching the posts themselves or just cheap representations of them (e.g., ID numbers, pointers, etc.).
So I might consider names like fetchPromotedPostIDsFromDatabase, retrievePromotedPostContent, inferPromotedPostsByModel, cachedPromotedPostList, etc. Or I might prefer a brief name like promotedPosts and put information about what it does and the likely performance implications in a comment, docstring, etc.
My intuition says that
if it’s called getPromotedPosts then it is probably fetching some information from somewhere—maybe the internet, maybe a database—and probably isn’t doing any computation to speak of;
if it’s called promotedPosts then it is probably either computing something or just using a value it already knows and can return quickly and easily.
I am not sure there’s any function name that would be perfectly neutral between (1) extremely cheap operation, probably just returning something already known, (2) nontrivial calculation, and (3) nontrivial fetching.
There’s also a bit of ambiguity about whether something called getPromotedPosts is fetching the posts themselves or just cheap representations of them (e.g., ID numbers, pointers, etc.).
So I might consider names like fetchPromotedPostIDsFromDatabase, retrievePromotedPostContent, inferPromotedPostsByModel, cachedPromotedPostList, etc. Or I might prefer a brief name like promotedPosts and put information about what it does and the likely performance implications in a comment, docstring, etc.