Hacker News new | ask | show | jobs
by Jacobi 5096 days ago
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.
1 comments

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.".