3 ms·
Boost bind and fast delegates do certainly suck. (I used to work in games in a past lifetime.) But this is most certainly a C/C++ problem. In Objective-C, th
by pkaler 14y ago
Boost bind and fast delegates do certainly suck. (I used to work in games in a past lifetime.) But this is most certainly a C/C++ problem.
In Objective-C, the @protocol keyword gives the language first class delegation and works really, really well. More details here:
http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/CommunicateWithObjects.html#//apple_ref/doc/uid/TP40002974-CH7-SW18 http://developer.apple.com/library/ios/#documentation/Cocoa/...
With respect to the original article, he's talking about callbacks with respect to Node.js. That's not a callback issue. Async is unnatural for the mind to grasp. What did he expect?
- jblow 14y agoI 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.