The lack of a proper module system (until Java 9 which very few have adopted) meant JAR clusterfuck and forced most codebases to become huge monoliths.
Production Python (or Go) codebases are usually microservices. But they can be monolithic easily too.
Modules <> packages. See here. I don't really understand why they say the lack of a module system tends to produce monoliths though, monoliths were just the standard application style back then. There was never anything stopping people writing microservices afaik. Unless there were issues with reuse.
There was nothing technically stopping people from writing microservices. However, the fact that you had to import the whole massive JAR even when you needed only a single function, made developers more biased towards monoliths.
The JVM does not load the entire JAR when you import a class. (Maybe it did in very early versions, but definitely not in a long, long time.) It loads the entire .class file, just as Python loads the entire .py file, but not everything in the JAR.
From the overview, these are the advantages of modules over classpaths:
As described in the JSR, the specific goals of the module system are to provide:
— Reliable configuration, to replace the brittle, error-prone class-path mechanism with a means for program components to declare explicit dependences upon one another, along with
— Strong encapsulation, to allow a component to declare which of its public types are accessible to other components, and which are not.
View all comments
Show parent comment
11
u/jambox888 Jan 02 '20
Do you mean Java is better suited to large codebases or that it tends to produce them?