News for hackers. Stuff that matters.
Re:Objective-C isn't what you think it is by Peaker on Wednesday February 26, 2014 @06:40PM (#7309115)
I've never heard anyone describe function pointers as meta-programming before.

Functions are data, just like other kinds of data. I use them in C whenever what I want to parameterize is behavior, and not, say, an integer or a string.

I believe that if you explicitly avoid function pointers, and instead use a less appropriate construct, that would become a mess, instead. If you replace the function pointer with an enum, you've tightly coupled the type definition of the parameter with all users. You've added a switch statement on the enum, rather than a function pointer call. It would be both messier and probably slower than the function pointer.

There are no comments on this comment yet.