News for hackers. Stuff that matters.
Re:The decline and fall of Java on the desktop by Cthulhu_ on Wednesday March 02, 2022 @04:43PM (#30533598)
Lombok is indeed a band-aid that replaces IDE-autogenerated code, which in turn is a band-aid for language design choices on the one hand (e.g. equals and hashcode), and accepted Best Practices in Java world like setters/getters everywhere; for the latter, you can either do public final fields, just use public fields until you need an accessor method (java's refactorings are great), or on the other hand add language features like in C# and Scala where from a class consumer point of view, accessing a value or calling a setter/getter are the same.

That said, I did hear Java is getting value types soon, or something like that. A bit too little too late maybe, but welcome nevertheless.

If I had the choice I wouldn't use Java again; JVM is fine, but there's better languages for it than plain Java. Kotlin seems alright. Wouldn't use Scala again, that's a language for sadists.

Re:The decline and fall of Java on the desktop by derefr on Wednesday March 02, 2022 @11:31PM (#30537193)
> That said, I did hear Java is getting value types soon, or something like that.

Java has had records (the thing that's like Lombok) since Java 14.

What Java is soon getting is inline value types, i.e. datatypes that work like primitives (are pass-by-value; have no identity but rather structural equality; are freely copyable; can be held on the stack, or intrusively within a containing array; etc.)

Re:The decline and fall of Java on the desktop by kaba0 on Wednesday March 02, 2022 @05:14PM (#30533977)
Java designers chose the public method with the same name as the corresponding field policy as the preferred one (as per record’s design), this combined with the coming syntax for “copy the object but changing these fields” will make java quite good to use imo.
Re:The decline and fall of Java on the desktop by tombert on Wednesday March 02, 2022 @04:53PM (#30533720)
Scala definitely has its irritations but I’ve grown to accept it. It has enough cool features to justify its existence.

I’ve not used kotlin but people I respect say it’s great, maybe that’s better than Scala.

Re:The decline and fall of Java on the desktop by lmm on Wednesday March 02, 2022 @10:17PM (#30536718)
IME Kotlin is the worst of both worlds. It's like they took every cool one-liner example from Scala and said "see, you don't need a whole functional language to do that, we can just add this piece of syntax sugar and you can do the same thing while keeping that Java feel", but once you've done that a half-dozen times you end up with a language that's actually even more complicated since it doesn't have the underlying consistent core that Scala does.
Re:The decline and fall of Java on the desktop by SOLAR_FIELDS on Wednesday March 02, 2022 @11:06PM (#30537050)
I like Scala a lot more than I feel like I should. It’s weird to say that it’s a language that feels too academic while also being heavily used by enterprises. I used it a lot while working at BigCo and there were a lot of times that the language got in the way of getting things done due to the design. But it is really elegant once you understand it. It’s no Lisp, of course, but it feels somehow both pragmatic and academic in getting things done. And for writing Spark, it’s quite expressive.
Re:The decline and fall of Java on the desktop by AtlasBarfed on Thursday March 03, 2022 @12:47AM (#30537616)
Why use Lombok if you can use Groovy + CompileStatic? Does lombok do anything groovy can't do?