Live data from Hacker News

Java 21 makes me like Java again

wscp.dev

351–360 of 777 posts

Re: Java 21 makes me like Java again

#352
post #34
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.

Nullable is a huge issue in Java, but annotation-based nullability frameworks are both effective and pervasive in the ecosystem (and almost mandatory, IMO). I'm really excited about https://jspecify.dev/ , which is an effort by Google, Meta, Microsoft, etc to standardize annotations, starting with @Nullable.

I was just writing about nullability annotations!

https://news.ycombinator.com/item?id=37534184

Re: Java 21 makes me like Java again

#353
post #99

Earlier quoted context omitted.

You must be really lucky then. In my previous job, inheritance and abstract classes were everywhere. Coupled with dependency injection frameworks that "worked like magic", it was really hard to follow the code inside that big, monolithic app. It made me never want to work with Java ever again.

I've never been a big fan of dependency injection. It solves a problem with unit testing in Java, sure, but the reality is that Java could have done some nifty things to help alleviate that as well.

Sounds like you’re confusing DI with DI containers.

Re: Java 21 makes me like Java again

#354
post #34

Earlier quoted context omitted.

Nullable is a huge issue in Java, but annotation-based nullability frameworks are both effective and pervasive in the ecosystem (and almost mandatory, IMO). I'm really excited about https://jspecify.dev/ , which is an effort by Google, Meta, Microsoft, etc to standardize annotations, starting with @Nullable.

I hope they succeed. So many people have tried.

Not having nulls is easy.

Persuading Java devs not to use nulls is hard.

Re: Java 21 makes me like Java again

#355
post #197

Earlier quoted context omitted.

Exception handling and generics are missing key pieces from go. But adding them will make go look like java. I just wish java would add null safety in the type system in a first citizen way. For enterprise use java has no competitors. You have c# which is microsoft trying to estabilish nash equilibrium fu*ing the developers. I am a bit worried about ever increasing complexity and a steep learning curve, but seems lik…

Afaik, no language as great of exceptional handling as Java. I prefer Go but I have to admit, Java's checked exception handling is amazing.

That is an extremely debatable topic. Which is why kotlin completely ignores checked exceptions.

Frankly, Id rather have a result and optional/nullable type like in rust/kotlin than deal with exceptions in any capacity.

Re: Java 21 makes me like Java again

#356
post #341

Earlier quoted context omitted.

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…

How do you distribute a Go library? How do you distribute a Go library that has dependencies?

[deleted]

Re: Java 21 makes me like Java again

#358
post #61

[flagged]

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.

> Kotlin as a platform is not mature enough to deserve the same qualification. With (1) a lot of Java backend projects migrating to Kotlin (let's be negative and assume 20%); (2) all of Android running Kotlin, which is around 80% of the world's mobile phones; (3) the world's best IDE authors building features and improving Kotlin; (4) the language being almost 13 years old at this point; and (5) Kotlin being 100% compatible with Java in both directions, I wonder what additional maturity would you be looking for. Can you point to a specific problem?

I mean, of course, Java has been here since forever and we've made careers out of programming for JVM. I'm wondering if you are referring to a specific maturity issue, or just want to highlight that Java was here for longer... if it's the latter, I don't think it can be a valid argument against Kotlin or in favor of Java.

Re: Java 21 makes me like Java again

#359

Earlier quoted context omitted.

> ideology built on top of the idea that inheritance is really good idea and belongs everywhere. Those are two different ideas.

I used the word "and" to indicate that, yes.

I think a comma would make it less ambiguous.

Starting that single though with "The" indicates to me that you don't think those are two different ideas.

Compare:

    the idea that inheritance is really good idea and belongs everywhere.
With:

    the idea that inheritance is really good idea. and belongs everywhere.
Post reply on HN