Java codebases vs LLVM - a study in modules and monorepos
Java codebases vs LLVM - a study in modules and monorepos
The Java language is best used, according to its own philosophy, to write code as self-contained, with lots of internal dependencies, and well-defined predetermined interfaces to other code. Several consequences arise in long-lived codebases as a result of this.
interfaces fossilize; it quickly becomes verboten to change how classes relate to other classes, because the dependency structure becomes too convoluted to disentangle or diff.
I say becomes because here the black box becomes hard to describe; what is actually happening is that a single agent with sufficiently large memory would not have issues, but a set of interacting bounded agents trying to minimise their rewriting/maintenance effort will inevitably make decisions to preserve and propagate suboptimal structures in the codebase because the dependency tree of the structure in question is too large.
my contention is that java "standards", by which I mean logical structures the changing of which would propagate to a lot of dependencies, tend to be shaped like interfaces.
also that this leads to specific absurdities in trying to attach any single task to the larger semantics of a codebase.
concrete examples will follow if it seems worth pursuing in depth; I have anecdotes and one-off examples.
inconsistencies arise because portions of the dependency tree are to be considered opaque wrt to their functionality, even though they are transparent structurally. The distinction breaks down in situations where, for eg.:
Class A has methods x and y where x and y are redundant
Class B, inheriting A, notices this, and overrides A.x to call A.y (i.e. B.A.x -> B.A.y, and B.A.y = A.y)
A is later rewritten to omit A.y; to deprecate A.y, it now calls A.x (i.e A.y -> A.x)
this means B.A.y -> B.A.x
The "package" idiom of software also has this problem in a more general sense
Here there is a much more robust body of examples. NixOS and the nix package manager were expressly written in order to address this specific set of issues.