2 ms·
I generally like writing hooks. They're fairly straightforward to understand (until they aren't, but that hasn't bitten me often yet). However, reading other pe
by servercobra 7y ago
I generally like writing hooks. They're fairly straightforward to understand (until they aren't, but that hasn't bitten me often yet). However, reading other people's hooks is a lot more mental overhead than the same class methods, IMO. Either you have strict coding standards around them (which are pretty hard to implement with automated tools, so hopefully your code review process never lets anythign slip through) or comprehending someone else's code takes longer. For that reason, I've stuck with classes for the time being.
- wilsonrocks 7y agoThis seems like a fair point about other people's custom hooks. An important situation where naming helps so people can at least see what they do, without worrying about documentation