3 ms·
I don't see it as fundamentally different. Callback means some or all of: "I don't know when or where I am being called from, or what the state is of the rest o
by jblow 14y ago
I don't see it as fundamentally different. Callback means some or all of: "I don't know when or where I am being called from, or what the state is of the rest of the program at this time." All of those are bad things if you are trying to write robust software, so you want to avoid them unless there's a really good reason.
- pkaler 14y ago"I don't know when or where I am being called from, or what the state is of the rest of the program at this time." Gotcha. A parent object should own a child object. The parent can directly call a method on a child. The child object shouldn't really know about the parent. Hence, it uses a callback/delegate/protocol. Callbacks are a mess if there isn't a clear parent to child relationship.
- jblow 14y agoI don't believe that parent/child relationships are a good way to structure programs. I use them sometimes, but very rarely. (Current codebase is 180k lines of C++).
- wwweston 14y ago> Callback means some or all of: "I don't know when or where I am being called from, or what the state is of the rest of the program at this time." This sounds a lot like what function means.