Comment on Is Java Still Keeping Up with Modern Programming Languages
BlueBockser@programming.dev 11 months agoLombok will shrink the 200 lines of getters and setters to one or two. It has its own pitfalls of course, but IMO it’s definitely worth it.
huginn@feddit.it 11 months ago
Corporate standards.
I’m pushing for no half measures: it’s Kotlin or bust.
BlueBockser@programming.dev 11 months ago
Definitely agree that Kotlin is so much better than Java + Lombok, but it’ll take a lot of time for all the existing Java projects or migrate to Kotlin or reach EOL. In the meantime, it’s hard to avoid the occasional Java project…
huginn@feddit.it 11 months ago
Sure but you can also just drop kotlin into any Java codebase. It’s a single line maven import and the entire company already uses Intellij
gravitas_deficiency@sh.itjust.works 11 months ago
Oh yeah - the seamless Java/kotlin interop is pretty slick, though there are some pitfalls - nullity is one of them. Kotlin treats it explicitly, but when it’s talking to Java, it’s forced to treat it ambiguously unless you wrap stuff in
Optional
. And then even if you do, some Java lib that you need to plug into your project might not do that, so you’ve got to be careful about managing the interactions between their interfaces in some situations. And then there’s the unfortunate divergence that’s started to occur as newer versions of Java have brought certain features that were first available in Kotlin into Java, but the patterns and interfaces often differ subtly, so you have to worry about that too, especially with less experienced engineers on the team.Don’t get me wrong - it’s great, and I’ve enjoyed working with it, but if you’re doing an incremental migration, make sure you test the ever-loving shit out of it.
Source: I did an incremental Java -> Kotlin migration on a huge project a couple jobs ago