2 ms·
The ecosystem is large and diverse. But you don't have to use everything! You don't have to use anything! I make a point of starting all new projects with just
by twic 6y ago
The ecosystem is large and diverse. But you don't have to use everything! You don't have to use anything!
I make a point of starting all new projects with just the JDK, and taking that as far as possible before adding dependencies.
A 40k LOC codebase i work on has these external dependencies (plus some company- and vendor-specific libraries, which we would need in any language):
1. Netty, for serving HTTP
2. Glassfish JSON, for parsing and formatting JSON
3. FastUtil, for efficient collections of primitives
4. Guava, purely to get PairedStatsAccumulator
5. SimpleFlatMapper, to parse and format CSVs
No frameworks, no criminal bloat.
For the first few years of its life, this app used the JDK's own HTTP server, which was fine. Then we wanted to add websockets, so we needed a more sophisticated server.
If there is a problem with Java here, it's that people don't realise you don't need frameworks. A lot of developers will reach for Spring, Java EE, or something else like that right at the start of a project, without questioning the need for it. But this is not a failing of the language, or a problem you have to impose on yourself.
- majjgepolja 6y agoAs a java n00b, thanks for listing the libraries. Do you know any other simple libraries which will be useful generally?
- twic 6y agoOh, there's millions of them. That's the problem!
- majjgepolja 6y agoI meant "refreshingly simple" ones, as in _antithesis of spring boot_
- Nursie 6y agoFor http serving, I've always like SparkJava, just because its interface is very simple. But it's not the only way.