News for hackers. Stuff that matters.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by avodonosov on Friday October 06, 2023 @02:28PM (#37794362)
What in the java language makes you think it is less suitable to be used without an IDE than other languages?
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()`.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by paulddraper on Friday October 06, 2023 @02:54PM (#37794711)
It's verbose to write and read.

You need an assist for both.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by palata on Friday October 06, 2023 @05:46PM (#37796855)
> You need an assist for both.

I don't. Do you?

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by collinvandyck76 on Friday October 06, 2023 @06:26PM (#37797154)
Obviously GP think it's helpful? Just because you're in the minority that doesn't need IDE or LSP assist writing Java, I think that most people would argue that assist for Java is beneficial even if you personally don't need it and there's no sense in flexing about it.

I personally always use IDE/LSP for Java, even though it's been many years since I've written it, because it helps me deliver business value faster.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by avodonosov on Saturday October 07, 2023 @02:10AM (#37799392)
We are comparing java with other languages here, not questioning advantages of IDE.

Why people think java without IDE is different than some other language without IDE.

Is java more verbose than, for example, C++?

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by palata on Saturday October 07, 2023 @02:46AM (#37799549)
Exactly this. Who develops in Swift, Kotlin or Rust without ever using an IDE nowadays?
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by paulddraper on Saturday October 07, 2023 @02:23AM (#37799456)
I do.

Or at least, it's a big, big improvement.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by palata on Saturday October 07, 2023 @02:44AM (#37799544)
And it is not for other languages? What makes Java special here?
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by paulddraper on Saturday October 07, 2023 @09:58PM (#37807205)
Good question. See my earlier comment.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by jillesvangurp on Friday October 06, 2023 @06:30PM (#37797191)
The fact that IDEs are just unusually smart specifically for that languages relative to relatively dumb editors like vs code, which lack most of the conveniences in the form of auto complete, a wide variety of refactorings, auto fixes, etc. Opting out of all that is not something a lot of people do. Botttom line, you are missing out on so many good tools by not using a proper IDE with Java that it's borderline negligent to opt out of that. It's negligent because you start opting into preventable issues (formatting, warnings, common bug patterns, dead code, etc.) and generally end up wasting a lot of time fixing things manually that you shouldn't have to deal with because your IDE should be doing those things. For example imports are not a thing I ever type manually. Not a thing. Most warnings are addressed with a simple alt+enter, which will typically suggest a usable fix. With and IDE you see those warnings and can act on them.

Kotlin has the same advantage and is developed by Jetbrains who also develop intellij and of course know what they are doing on this front. Support for other languages in intellij is also nice but typically a lot more limited than the support for Java and Kotlin. E.g. pycharm is alright for python but not that much different from what you get in vs code. You get a handful of refactorings and that's about it. Dynamically typed languages are just a lot harder to support with proper tools. Too much uncertainty about what does what or even what types things are.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by avodonosov on Saturday October 07, 2023 @02:05AM (#37799374)
You describe the great advantage IDE gives. My point though is that without IDE java is basically as good as most other languages without IDE.

I've spent years coding in java daily, most of the time in IntelliJ of course. But there was a time when I had to use for a project a very modest editor, with just basic syntax highlighting. After several days you get used to it and it does not bother you.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by jillesvangurp on Saturday October 07, 2023 @02:46AM (#37799554)
Which would put you at a disadvantage relative to other Java programmers. In many teams, that would not be tolerated if you then start committing code with obvious issues related to your poor tooling choices.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by ResearchCode on Saturday October 07, 2023 @07:35AM (#37800847)
I hope those obvious issues are caught by your reviewers and integration tests before they are committed.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by palata on Saturday October 07, 2023 @03:46PM (#37804926)
How did you jump from "After several days you get used to it and it does not bother you" to "you then start committing code with obvious issues"?

You can't just make up stuff and then blame other people for it...

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by lern_too_spel on Friday October 06, 2023 @06:40PM (#37797266)
Class-level imports and lots of classes.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by theanonymousone on Saturday October 07, 2023 @05:12AM (#37800235)
My other language of heavy use is Python. Maybe not writing a Python script from scratch, but at least I can modify a Python script in some basic editor (e.g. GitHub web UI). The same thing will be more difficult in Java.

I cannot judge about Rust and C++ which are mentioned here. I also write some Scala and it is not far from Java in that manner.

Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur... by palata on Saturday October 07, 2023 @03:48PM (#37804949)
I agree, writing Python is easier without an editor than writing Java, Scala, Kotlin, Rust or C++.

This said, Python is often completely unsuitable for jobs solved by Java, Scala, Kotlin, Rust or C++. So I don't think it is a fair comparison.