Hacker News new | ask | show | jobs
by 8n4vidtmkvmk 700 days ago
What about methods that share a signature but have a different meaning?

The interface can have a comment documenting what it's supposed to do. Any class/function that explicitly implements said interface should adhere to that definition/meaning. Any function that implicitly implements it... who knows what was intended.

1 comments

In theory, you have a point. However, in practice it doesn't matter. It is extremely unlikely that the code is written in a way where random, unknown implementations are being passed around and called.
But then, in practice, why is it a problem to be explicit?
It's not; never said as much.