News for hackers. Stuff that matters.
Re:Java Is Underhyped by zerotolerance on Thursday April 15, 2021 @11:23PM (#26829054)
Speaking as a near 20 year Java programmer, Java is criminally bloated at every level. The ecosystem has been covering for its shortcomings since y2k. That ecosystem is so thick and full of abstraction that no two devs from different framework backgrounds would recognize the others code as Java. And the abstraction... it is a language for people who are more interested is the abstractions than actually getting things done.
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_
Re:Java Is Underhyped by tirrex on Thursday April 15, 2021 @11:35PM (#26829139)
I agree with you.

Actually, Java has great tooling, JVM is very nice, it has great potential for high performance code generation. It has everything for debugging. But at the end of the day, language is driving people to write bloated software.

I just wonder, how come e.g Linux kernel code 100 times more readable than any project in Java? More importantly, how did we come to this point that we accept bloated/unreadable code in the name of higher/better languages?

Re:Java Is Underhyped by thu2111 on Friday April 16, 2021 @05:29AM (#26831612)
Linux isn't readable because of C. My god, just go look at the source code of most GNU projects like glibc or gcc if you want to disabuse yourself of that notion.

Linux is highly readable because Linus imposes readability on it through sheer force of will, and because they are willing to sacrifice driver API on the altar of clean code. The result is a very efficient and readable kernel that hardly anyone uses in the environment with the most complex and heterogenous hardware i.e. desktops and mobiles. Android doesn't really use Linux these days. Since some years it has developed its own stable driver ABI that bypasses the kernel for most things.

If all Java codebases were run by a dictator-for-life who could sacrifice trifling details like adoption in order to get the most readable code possible, you'd find you'd like them a lot more too. And a few such codebases are actually like that! Look at the source code of the JDK itself sometime (not the bits by Doug Lea though), or Guava, or really quite a few open source Java projects have readable and nice code.

Re:Java Is Underhyped by loopz on Friday April 16, 2021 @01:22AM (#26829823)
Java won by its portable deployment model, stack traces, GC, libraries and security sandbox safety. In over two decades, very few other platforms have come close to its promises. C# is perhaps much better, but has stronger proprietary ties and vendor lock-in.

Java became overcomplicated by frameworks and design patterns, so has always felt bloated and slow. But has worked best for business logic. Though is maybe behind COBOL thus far, and tends to hide/obscure logic. No two java designs looks the same, scales well or converge to clear consensus. The language did lower the bar for what cheap programmers could accomplish faster though.

Re:Java Is Underhyped by benbristow on Friday April 16, 2021 @12:32PM (#26835978)
> C# is perhaps much better, but has stronger proprietary ties and vendor lock-in

What vendor lock-in? The whole thing is open source from the compiler to the runtime - https://github.com/dotnet

If anything Java is more locked in as the most popular and 'official' runtime/devkit (Oracle Java/JDK) is completely closed source.

Re:Java Is Underhyped by abraxas on Friday April 16, 2021 @09:01AM (#26833324)
I don't think you experienced NodeJS development. There isn't a built in collections library. They all had to import a string leftpad function which then broke half of the world when it was pulled from their repository by the original developer.
Re:Java Is Underhyped by Nursie on Friday April 16, 2021 @05:12AM (#26831474)
Honestly I think it's time for some of these frameworks and abstractions to die, and to stop trying to be everything to everyone.

Ship functionality as libraries, not massive sets of "Thou shalt do it our way in our all-encompassing , over-complex, hard to debug straitjackets."

The language itself is not what it was, it's very capable.