Vocabulary: Should I call this apply or map?
- by Carlos Vergara
So, I'm tasked with organizing the code and building a library with all the common code among our products.
One thing that seems to happen all the time and I wanted to abstract is posted below in pseudocode, and I don't know how to call it (different products have different domain specific implementations and names for it)
list function idk_what_to_name_it ( list list_of_callbacks, value common_parameter ):
list list_of_results = new list
for_each(callback in list_of_callbacks)
list_of_results.push(callback(common_parameter))
end for_each
return list_of_results
end function
Would you call this specific construct a
list ListOfCallbacks.Map( value value_to_map)
method or would it better be
value Value.apply(list list_of_callbacks)
I'm really curious about this kind of thing. Is there a standard guide for this stuff?