News for hackers. Stuff that matters.
Re:Java Is Underhyped by twic on Friday April 16, 2021 @05:24AM (#26831563)
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.

Re:Java Is Underhyped by majjgepolja on Friday April 16, 2021 @05:52AM (#26831799)
As a java n00b, thanks for listing the libraries. Do you know any other simple libraries which will be useful generally?
Re:Java Is Underhyped by Nursie on Friday April 16, 2021 @06:17AM (#26831979)
For http serving, I've always like SparkJava, just because its interface is very simple.

But it's not the only way.

Re:Java Is Underhyped by twic on Friday April 16, 2021 @06:10AM (#26831918)
Oh, there's millions of them. That's the problem!
Re:Java Is Underhyped by majjgepolja on Friday April 16, 2021 @11:11AM (#26834850)
I meant "refreshingly simple" ones, as in _antithesis of spring boot_