It's fair to say I've been very dismissive of this proposal, my main arguments against it:
- I don't think the 'lack of a hook system' causes problems. I think its the lack of hooks (whether 'hooks', or existing callbacks etc). I don't think that introducing the hook system will solve that lack of hooks. I don't see how we get to a useful hook system without extensive hooks landing too.
- Moodle was not built this way, the architecture is quite opposite to (say) drupal - for many developers, this is a plus because it makes the code easier to understand with less indirection going on.
- It begins to muddy the potential new API design - do we use hooks or a traditional Moodle OO/module callback approach
- The potential for converting existing callbacks to hooks is just another thing which puts a burden on third party developers, so I wouldn't love to see that sort of change for changes sake
- A little bit of the viewpoint expressed by Tim in his old blog post - that the ability to hack the sourcecode is a solution for many institutions.
While I mostly stand behind my previous concerns, as time goes on and people mention the hooks system at any available opportunity, it wears me down and I consider if its something we should add to ensure it's not the 'lack of the system' which is constraining us.
There are some use cases where I am starting to become attracted to the idea. It comes down to the times when some sites want to change some fundamental functionality, it's too niche to expose everyone to setting and too small to invent a new plugin type (particularly larger Moodle deployments). These sort of scenarios seem to end up with us ever increasing our settings, or complex design considerations of how to support everyone with the new system and not simplifying. A current example which has sparked my thinking off in this is MDL-28030.
I think in my vision of this, the hooks would not be used in our API design (it feels too counter to that). The hooks would start small in number and grow organically as real deployments find a need to hook in places. So rather than what happens now - where institutions need to either hack core or spend a great deal of time make their development sufficiently generic and considered enough for all cases, they could put the smaller investment of introducing a hooking point. In summary, i'm arguing against my first point - that having the system is worthwhile.