Live data from Hacker News

Java 21 makes me like Java again

wscp.dev

391–400 of 777 posts

Re: Java 21 makes me like Java again

#391
post #2

Nice article as someone familiar with sum types but not sum types in Java. I don't know if sum types alone are enough to get me to like Java, pervasive nullability is still around and even rears its head multiple times in this article.

It's also not expression orientated yet.

Fortunately switch has now an expression variant. But I would die for an if-else expression (very subjective, but I would prefer a more verbose if-else to ternaries), and especially a try-catch expression!

Re: Java 21 makes me like Java again

#392

Earlier quoted context omitted.

I don't think any existing Go developer is going back to Java. I worked with Java for 10 years and switched to Go and I will never go back. This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go. Go is simple. It's easy to understand, read, and maintain. The packaging is like how you would package files on your co…

Go's major selling point to me is that you can ship one binary, nothing beats that. Python, Node, Java all have to pre-install lots of dependencies before you can use them, fine for developers, not so great if you want to distribute software for people who are not software savvy, who typically just wants to download one file, install and start using it. c and c++ can also do one executable, but, it is not as portable…

> Go's major selling point to me is that you can ship one binary, nothing beats that.

Are .war files no longer a thing? ;)

Re: Java 21 makes me like Java again

#394
post #240

Earlier quoted context omitted.

That escalated quickly. There are good and less good people everywhere and using language X does not automatically tell anything about you. If anything I think the cases where you can use Go successfully are only o fraction of the cases where you can use Java successfully. It's not necessarily Java itself but the ubiquity of the JVM and its ecosystem (see Kotlin, see Scala as examplea that have leveraged this ecosyst…

> the cases where you can use Go successfully are only o fraction of the cases where you can use Java successfully could you elaborate why do you think so, and maybe give examples of cases where Go can't compete with Java?..

Libraries for application programming, last time I used Go nothing came close to the Java PDF creation libs for example.

Re: Java 21 makes me like Java again

#395

Earlier quoted context omitted.

As someone writing code on Java since v1.0 and making tech strategy decisions on the C-level, I consider myself sane and experienced enough to say that Java is something that will do the job well and can be the primary choice for startups and new projects. Kotlin as a platform is not mature enough to deserve the same qualification.

The job of software engineers is to translate a business domain into software. Different languages are better or worse at modeling different domains of problems. I have seen the same problem solved in different languages take 2-3x the amount of work and have a large difference in ongoing maintenance costs. Java's reliance on traditional OO means that only a small subset of business domains naturally map to the langua…

> I have seen the same problem solved in different languages take 2-3x the amount of work and have a large difference in ongoing maintenance costs

I am sure none of this experiences were basis for an objective experience, there are too many variables. But surely, there are (very few) problems that doesn’t fit Java too well, though it is not an OOP-only language, it is a multi-paradigm one, with many FP concepts seeping into it.

E.g. for some ultra low-lat audio processing I wouldn’t choose it, your binary stream processing may be another good example, though it depends on a bunch of factors and in many cases java is more than fine for that as well.

Re: Java 21 makes me like Java again

#396

Earlier quoted context omitted.

I don't think any existing Go developer is going back to Java. I worked with Java for 10 years and switched to Go and I will never go back. This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go. Go is simple. It's easy to understand, read, and maintain. The packaging is like how you would package files on your co…

Go's major selling point to me is that you can ship one binary, nothing beats that. Python, Node, Java all have to pre-install lots of dependencies before you can use them, fine for developers, not so great if you want to distribute software for people who are not software savvy, who typically just wants to download one file, install and start using it. c and c++ can also do one executable, but, it is not as portable…

I suggest reading about GraalVM...

Re: Java 21 makes me like Java again

#397

Sad this gets to front page while a blog post which documents that .NET 8 has 200 A4 pages worth of performance improvements gets absolutely ignored. C# keeps being the language people are looking for but don't know about.

Since it is a Java thread, I’m gonna mention that ecosystem-wise, the JVM is just much much bigger and of higher quality - you very often see copied JVM packages in C# with much less features, less stability, and often even being paid.

With that said, it is a cool language and platform, that is indeed underhyped.

Re: Java 21 makes me like Java again

#399

> This set of changes allows Java to express one of the foundations of functional programming that the language never could before - Algebraic data types, along with idiomatic ways of using them. And here I thought the foundation of functional programming was functions , which Java still doesn't have. Seriously, functional programming is about functions, not types.

How is Math::sqrt not a function in Java? Sure, it’s called a static method and it lives in a class - but is it meaningfully different from the same being a function in a Math namespace in say, C++? You can static import it even and use it as a function. This is just needless hair splitting imo.

Re: Java 21 makes me like Java again

#400
post #246

Earlier quoted context omitted.

Kubernetes is what I would call very advanced use case. But that's the thing with Java, yes there are libraries for everything and one could see that as a problem actually. Spring was mentioned before, but it's the perfect example of an overengineered/ heavy library that does a lot of black magic.

If all you have is spring boot, everything looks like a spring boot problem.

Plus Spring is honestly quite badly programmed.

The pagination object is bulky and unnecessarily complex, where a simple offset/limit is enough (and a nextUrl for cursor-based access).

When we looked into cluster locks, they’re not even released if one node goes down. I mean, who would need a lock implementation that just stores a line in a DB? And the doc doesn’t even warn about it.

Apache contributors were much better-skilled.

Post reply on HN