Hacker News new | ask | show | jobs
by bigdubs 4382 days ago
monkey patching specifically is pretty heinous in c# but can be done. you should avoid monkey patching in almost any situation though.

one point of yours that i don't understand is the ability to reason about what methods are being called without message passing. if you understand the inheritance hierarchy it should be pretty easy to think about what 'version' of a method is being called? between the known inheritance path and a call stack at runtime this isn't something i find myself missing from obj-c.

where the call stack / inheritance hierarchy does get messy is in calling virtual methods from within constructors, which is a bad practice generally, and something apple devs touch on in the wwdc demos.

1 comments

Care to share some resources on C#/.net monkey patching? Tia