4 ms·
> A module is a collection of packages that are released, versioned, and distributed together. Each package within a module is a collection of source files in t
by pxeger1 5y ago
> A module is a collection of packages that are released, versioned, and distributed together. Each package within a module is a collection of source files in the same directory that are compiled together.
I wish Go had got these names the right way round. Every other programming language and packaging (NB. not "modeling"!) ecosystem uses package to mean distribution, and module to mean compilation unit.
- lstamour 5y agoIt could be worse, it could be Java. I might be wrong here, but as I understand it: Java’s use of the terms module and package which these days vary depending on context. Once upon a time, you put modules of code in a namespaced package, but then these packages were distributed and run as modules, and suddenly both package and module ceased to have clear meanings - context is required. Then again, maybe we should make up new terms instead of re-using existing ones. Like Ruby “Gems” or Homebrew’s “Casks”. It’s not intrinsically descriptive, but it is unique and unambiguous. I suppose again it could be worse, we could be talking about “libraries” and “frameworks” while describing “modules” and “packages”.
- pjmlp 5y agoThose packages were distributed and run as JAR, WAR or EAR files. I never remember having seen them referenced as modules.
- lstamour 5y agoOSGi modules? It’s true there are other names, but if you Google “Java 9 packages modules” you’ll get some very weird results. For example: https://softwareengineering.stackexchange.com/questions/311280/why-are-packages-and-modules-separate-concepts-in-java-9 https://softwareengineering.stackexchange.com/questions/3112...
- pjmlp 5y agoOSGi modules are related to Eclipse and how they modularized their components. Yes modules in Java don't mean the same thing as in Modula-2, Ada has packages, child packages and nested packages, Object Pascal/UCSD Pascal has units, while VMS Pascal has modules, and so on. There is plenty of literature to educate onself about the subject instead of Internet random searches.
- Cthulhu_ 5y agoI dunno, I feel like 'module' communicates something that is only code, while 'package' - but this is my JS experience speaking - implies it may also contain non-code files like docs, tests, examples, configuration files, html, etc that aren't directly used by the application importing them.
- littleroot 5y agoModules = Lego bricks used to build bigger Lego artifacts Package = Lego bricks (probably share a theme and are meant to build something concrete together), shipped with instructions and media and whatnot, in a, well, whole package.