3 ms·
Monkey patching is pretty common for when you want to override or get on-change notifications for interfaces that don't support it. For example, have header fi
by iam 15y ago
Monkey patching is pretty common for when you want to override or get on-change notifications for interfaces that don't support it.
For example, have header files for functions? Want to know when they're called? Monkey patch it in!
Also, from what I've heard monkey patching a function is calling adding a detour, and monkey patching a virtual function is called hooking. "Monkey patching" usually refers to injecting code into dynamic languages, not into compiled languages.
- devicenull 15y agoIndeed, detours/hooking is the correct terminology here. I've never heard anyone ever refer to this as monkey patching when it's done on with a compiled language.