Higher-Order Messages in Cocoa
Subject:   Let HOM be your mantra
Date:   2005-06-23 16:40:08
From:   georgerix
Response to: Let HOM be your mantra

(I'm posting from my Dad's account for the moment--apologies for any confusion this causes.)

There really is no problem with makeObjectsPerformSelector:; it's a handy mechanism to have when you need to perform an operation over an array. However, it doesn't yield the full flexibility of a mechanism such as blocks or trampolines, whereby you can define methods (like collect, select, reject, and detect) which return (and in the case of detect, operate) differently.

makeObjectsPerformSelector: is more or less equivalent, when combined with its siblings which take further arguments to use, to the HOM method do, but more complex uses require invocations... trampolines and HOM are basically a system to make invocations automatically-- that is, to make them conveniently.

As much as anything else, it's a matter of style.

Thanks for the comments!