Sealed protocols

What if "users" is not just "other teams using some library I developed" (for which I'm of course not responsible), but "my coworkers (some of which might be working on different subsystems) accidentally misusing a part of the code that I wrote as a separate module, and if they do it will affect me too"? I would say that, all else being equal, having the compiler being able to verify properties about your program should be preferable to having to rely on human judgement.

5 Likes