Skip to content

Comment on Closures for class/module privacy considered harmfulparent

Comments

That would be why bulk of the article is about how you shouldn't actually want to completely hide your internals, and it's not a completely terrible argument.

It does ignore the other benefit of module-closures, though (avoiding namespace collisions). Explicitly exposing your "private" functions (prefixed with _) in the module object would be a better way of achieving what the author wants.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.