Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>If anything it enables the enforcement of strong invariants and leads to better and safer code.

How?? If a container have `get(K)->V` and `remove(K)->V` then how does it preserve this invariant? This is an impossible contract to satisfy once you try to push once and pop twice. The container is promising you something that it can't satisfy, I would rather have a container that's honest with `get(key)->Maybe(value)`.



You have it backwards, the strong invariant is that you have a container and not a maybe container.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: