News for hackers. Stuff that matters.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by matsemann on Friday October 06, 2023 @02:37PM (#37794484)
It used to be lots of boilerplate. Like

MyClassType myClassType = new MyClassType()

And then it was nice to use an IDE to help write some of that. Or generate java beans etc.

But with that said, I don't think it's much you need an IDE for, it's more that java enables IDEs to do much more than it can for certain other languages.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by vips7L on Friday October 06, 2023 @03:46PM (#37795343)
You haven't had to declare the type since Java 10.

   var myThing = new MyThing();
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by matsemann on Friday October 06, 2023 @04:04PM (#37795595)
Yup, hence "used to", but I could be clearer it's no longer an issue.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by vips7L on Saturday October 07, 2023 @09:51PM (#37807171)
My issue with your statement is that you're pretending that this was a recent issue. This hasn't been an issue in over half a decade. Do we point out bugs in libraries from 6 years ago? Are we critical about what other languages looked like then? In my experience, Java is the only one that gets this criticism.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by riku_iki on Saturday October 07, 2023 @01:02AM (#37799127)
still need it for class members, unlike in some other languages.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by kaba0 on Saturday October 07, 2023 @03:16AM (#37799700)
Most languages don’t do type inference in “signatures” (function, but also class/struct members), as it would give you negligible benefit, a huge cost for the compiler and is commonly thought of as a bad practice.

Out of Scala, Rust, I believe even Kotlin, none do inference in these places. Even Haskell, which does infer function signatures as well, need explicit type annotation for `data` definitions.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by riku_iki on Saturday October 07, 2023 @03:24AM (#37799736)
typescript does such inference.

I disagree with you about huge cost for the compiler and benefits are the same as in normal code block: reducing boilerplate.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by kaba0 on Saturday October 07, 2023 @03:41AM (#37799827)
Typescript’s type system is deliberately not sound though.

In general, there is no type inference available for OOP type-hierarchies as opposed to a more Haskell-like type system, where Hindley-Milner works

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by riku_iki on Saturday October 07, 2023 @02:39PM (#37804332)
I don't have strong knowledge in types theory, but why

class C { a: int = 0; }

can't be replaced with

class C { a = 0; }

? what issues it brings?..

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by kaba0 on Saturday October 07, 2023 @07:10PM (#37806286)
That can. But what about a field that is not initialized there?
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by riku_iki on Saturday October 07, 2023 @07:23PM (#37806374)
obviously you would need to provide type.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by palata on Friday October 06, 2023 @05:50PM (#37796894)
That's a thing I don't get. Maybe I am doing something completely wrong, but the vast majority of my time as a developer, I am not typing code. I can afford 5s typing `MyClass myClass = new MyClass()`.