ES Modules: suggestions for improvement

Axel Rauschmayer axel at rauschma.de
Fri Jun 29 16:49:24 PDT 2012


> In Java, they didn't even *have* a module system because classes did double-duty as a data abstraction, a constructor, a type definition and a module.

Not that it affects your arguments, but that is not entirely true. With packages, you’ve always had a namespacing mechanism that was easy to understand (because it mapped directly to directories) and prevented name clashes (thanks to its reverse domain name convention). And there was package-private visibility. So packages are like 30% of a module system. Classes were mainly used as modules when Java needed to work around not having functions (via static methods), a bit like JSON, Math, et al.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120630/04972069/attachment-0001.html>


More information about the es-discuss mailing list