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

In Pattern: Defensively Handle Constructors, it recommends using a nested inner module with a private Seal type. But the Seal type is unnecessary. The nested inner module is all you need, a private field `_private: ()` is only settable from within that inner module, so you don't need the extra private type.




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

Search: