News for hackers. Stuff that matters.
Re:Dependency Inversion in C Using Function Pointers by Jacobi on Monday July 09, 2012 @05:50AM (#4217382)
The article describes an implementation of the observer pattern in C ... It's well known and used in many open source C projects. But I'm not sure that replacing simple tangled dependencies in the Linux kernel by using function pointers is a good idea. Because you may introduce an overhead in some performance critical code. And you may lose the locality of reference when abusing function pointers.
Re:Dependency Inversion in C Using Function Pointers by ernstsson on Monday July 09, 2012 @09:36AM (#4218070)
Yes the example used to explain dependency inversion indeed happens to be an observer pattern. Well known yes, at least amongst experienced C programmers, but as mentioned in a comment on the page; "all the more reason that it should be explained in blog posts.".