Vocabulary: Should I call this apply or map?

Posted by Carlos Vergara on Programmers See other posts from Programmers or by Carlos Vergara
Published on 2012-10-25T21:42:05Z Indexed on 2012/10/25 23:15 UTC
Read the original article Hit count: 191

Filed under:
|
|

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?

© Programmers or respective owner

Related posts about learning

Related posts about naming