Live data from Hacker News

Java 21 makes me like Java again

wscp.dev

751–760 of 777 posts

Re: Java 21 makes me like Java again

#751
post #424

Earlier quoted context omitted.

Which is a non starter for businesses that don't ship source code.

Businesses that want to sell libraries without a source code license can ship APIs.

Not sure I understand what you mean here. How do I ship the API of my library without shipping the library?

Re: Java 21 makes me like Java again

#752
post #341

Earlier quoted context omitted.

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

I'm not sure if your question is rhetorical, but Go doesn't have the concept of compiled library that you can link to another binary. So in Go you make available the library's source code, and the end-user will download it at build time, or vendor it in the source tree.

Right, so it feels like Go hasn't solved this problem. It just completely ignores it.

Re: Java 21 makes me like Java again

#753
post #349

Earlier quoted context omitted.

> No, there's a lot wrong with inheritance. No, there is a lot wrong with bad code . No need to blame the language or any programming concept. Note that I say that for all programming languages, not just Java.

That's a difference between a dangerously unsafe tool and a good tool. By unsafe I mean providing enough of footguns to shoot yourself in the foot. Java has a community of people that indulge in teaching about inheritance as the first thing after classes in their "OOP" lessons. This ingrains the habit in beginners.

> By unsafe I mean providing enough of footguns to shoot yourself in the foot.

Just to play on the comparison: would you say that a gun is a "dangerously unsafe tool"? I would tend to think that guns have been very well optimized over time, and I don't know of a gun design that prevents me from shooting myself in the foot. Actually that would be a limitation of the gun.

But we all agree that people who use guns need to learn how to use them properly. Why doesn't this apply to programming languages? How did we as an industry end up in a place where it's considered the norm that developers don't really know what they are doing and need some kind of child safety in order to not hurt themselves?

Re: Java 21 makes me like Java again

#754
post #718
post #666

Earlier quoted context omitted.

Combining the best parts of Java and JavaScript isn't exactly something to boast about. Dart lives and dies with the Flutter framework. Other than that it's not doing anything special. Not terrible but also not a significant improvement.

I mean you’ve taken my point, cut it in half to remove the relevant context and are now arguing against a point you’ve made up as some kind of gotcha… I don’t know what you want me to say to that. Same with your second point. I made a big point to explicitly say I think that right now Dart is very underused and has a huge potential outside of Flutter. Quoting that back to me as though it was something I hadn’t consid…

You say Dart is underused, but why build something new with Dart when you could do the same thing with a better language? The only reason to use it is Flutter.

Re: Java 21 makes me like Java again

#755
The author cites this to justify the need for Records:

> Most Java objects set every field to be private and make all fields accessible only through accessor methods for reading and writing.

> Unfortunately, there are no language enforced conventions for defining accessors; you could give the getter for foo the name getBar, and it’ll still work fine, except for the fact that it would confuse anybody trying to access bar and not `foo'.

Scala supports pattern matching on objects implementing the `unapply` method.

Is this considered harmful? Why didn’t Java follow this route?

Re: Java 21 makes me like Java again

#756
post #754
post #718

Earlier quoted context omitted.

I mean you’ve taken my point, cut it in half to remove the relevant context and are now arguing against a point you’ve made up as some kind of gotcha… I don’t know what you want me to say to that. Same with your second point. I made a big point to explicitly say I think that right now Dart is very underused and has a huge potential outside of Flutter. Quoting that back to me as though it was something I hadn’t consid…

You say Dart is underused, but why build something new with Dart when you could do the same thing with a better language? The only reason to use it is Flutter.

Familiarity comes to mind. Dart has developed into a nice direction with sound null-safety, extension functions, sealed classes and compilation to native&wasm. (The libaries weren't very mature when I used Dart, not sure if that changed.) I'd pick Kotlin because I'm familiar with it, but if mdhb is familar with Dart, maybe from his work with flutter, maybe from a time where you'd mostly use Dart to compile it to js, then go for it. Dart is a nice enough language to earn my thumbs up. (not that that would be important to anyone.)

Re: Java 21 makes me like Java again

#757
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…

Go has had generics for more than a year now

I agree, Go has had generics for a little while (of course they are different from Java's generics because Go's type system is different from Java's type system) and I don't think the parent comment writer was aware of that.

Re: Java 21 makes me like Java again

#758
post #718

Earlier quoted context omitted.

I mean you’ve taken my point, cut it in half to remove the relevant context and are now arguing against a point you’ve made up as some kind of gotcha… I don’t know what you want me to say to that. Same with your second point. I made a big point to explicitly say I think that right now Dart is very underused and has a huge potential outside of Flutter. Quoting that back to me as though it was something I hadn’t consid…

I'm with you, I think that Dart is very sensible and very underappreciated language. But he does have a point in saying that currently Dart is tied to Flutter. Google is presenting Dart as a language that you write Flutter with, not as a separate entity. I'd much prefer if Google would present Flutter as a GUI framework for Dart, but alas. Perception is everything. As much as I'd love to start my next project in Dart…

I support that. I tried Flutter a few years ago, and I liked Dart and the Flutter way of defining the UI (compared to the old xml stuff in Android).

Then I moved to Kotlin + Jetpack Compose, and I don't see the point of Dart anymore.

Re: Java 21 makes me like Java again

#759

Earlier quoted context omitted.

> You mentioned "distribute software" but did not consider Electron for Node. Sorry for the snark, but users will undoubtedly be very grateful to them for not considering Electron.

I'm not so sure if the users of VS Code, Discord, Slack, etc would agree. Yes it's bulky and sometimes slow, but it offers a lot of features and allow developers to ship features and updates really fast, while only needing one codebase for all platform.

Haven't used VScode, but Slack absolutely sucks IMO (on Linux). I don't even want to install Discord, I use it from the website (but I'm pretty sure the Electron app would be similar to the Slack one).

> Yes it's bulky and sometimes slow, but it offers a lot of features and allow developers to ship features and updates really fast, while only needing one codebase for all platform.

So you are saying that it is bad for the user (bulky and slow), but good for the developer productivity. I really don't see how the users could like the fact that the developers are being more productive while making a worse app.

Re: Java 21 makes me like Java again

#760
post #662

Earlier quoted context omitted.

I'm not a lawyer, I wish it's as simple as "it's just LGPL", it's not. Otherwise Qt has already conquered the desktop GUI world, it did not for a reason: the license mess.

It did conquer (-ish) the desktop GUI world, for a while: quite a lot of software was written in it. And then Electron happened.

> And then Electron happened.

Which is worse for users, but better for developer productivity (probably nicer for developers too: C++ is not exactly fun).

I am still hoping that JVM Desktop apps come back at some point, maybe with Kotlin Multiplatform?

Post reply on HN