I probably wouldn’t do that, as it’s a developer issue to care about adhering to this requirement and it’s probably not related to any user input. E.g. this could be covered by (integration-) tests, which lets the real code be much more readable and simple while caring about the “does is actually work” in the place that’s meant to check that.
Fair enough. I was learning towards that logic. However because I am in the process of writing a library there is a bit of me that thinks any pointers for mistakes beginners might make would be useful
I have decided to implement this check, here. In summary I think has the opportunity to be very helpful to beginners. I will keep an eye on feedback, if any, that I get.
I know this is an ancient topic but due to interest in the original problem I think it’d be worth it if you share how did you solve it – especially with your link now being dead.
I asked the same question on StackOverflow last year (didn’t see this thread), and thought the answer was pretty good:
It’s essentially the same as what LostKobrakai gave earlier in this thread: when given a module, assume it implements the behaviour. It’s not your behaviour’s job to check.
I get the philosophy and do my best to follow it in my work. Often times people have to work with legacy code however – or can’t allocate the time to rearchitect the app – and then having a runtime check is really helpful.