Live data from Hacker News

Java 21 makes me like Java again

wscp.dev

651–660 of 777 posts

Re: Java 21 makes me like Java again

#651
post #645

Earlier quoted context omitted.

Teasing this apart I see a few things: a) logging, b) modules rollout and c) missing frameworks. I’ve never had a logging issue in large systems. Explicit error return (as you know, on every function) allows you to log in your code, not lean on only libraries that support your interface. Modules rollout was part of growing up. But, you won’t get Go 1->2 upgrade issues as we have 100% backward compatibility on version…

> Too many allocations for Go is going to be too many allocations for JVM too No, Go’s GC is a toy compared to the JVM’s. It is lowerish in latency by actually stopping the application threads when under high contention. Java doesn’t slow down the allocation rate, it tries to keep up with the churn.

I’d love to see you elaborate on this. Anecdotally, my experience was the exact opposite. Is there some documentation making this point?

In the course of optimizing I came to know the various JVM GC algos (concurrent mark/sweep, parallel old, etc) by the corresponding memory graph alone. I never, ever had to debug similar latency in the Go stack.

Re: Java 21 makes me like Java again

#653
post #195

Earlier quoted context omitted.

> This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go. You are just at the early phase of the project. > Go is simple. It's easy to understand, read, and maintain My opinion is that Go is too simple, to the point that it hinders understanding and readability. 4 nested loops with random mutability is much worse…

Im convinced Go is just an incomplete language masquerading as a simple one.

Go is a complete and simple language, and this is a fairly objective claim.

Unless by "incomplete" you mean it could have more features. But C++ and Rust (and Java) have been piling on features for years, with no signs that they will ever slow down or stop, proving that they're also "incomplete" by this definition. IMO this is really just a result of there being too many cooks in the kitchen, and a lack of leadership committed to saying "no" to feature requests.

This is also why using Rust or C++ requires every organization to agree on a subset of the language they will utilize. Rust isn't as far along this path, but it's heading in the same direction as C++.

But with Go, every organization can use the complete language. That's how simple it is.

Go has been used by many organizations to build stable, large, and scalable systems that have been operating successfully in production for many years now. That's how complete it is.

Re: Java 21 makes me like Java again

#654

Golang is simple, smart and opinionated subset of Java/C#. Everything moves slowly in corporate world. It will take another at least 2-3 years for large community of Java ecosystem and average devs to adopt Java 21 and capabilities.

Go is just a dumb subset hyped up as simple, but it is useless and slowly it will have to introduce all the remaining pieces in some ugly way as they didn’t plan with them ahead of time - see generics.

Re: Java 21 makes me like Java again

#655
post #195

Earlier quoted context omitted.

> This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go. You are just at the early phase of the project. > Go is simple. It's easy to understand, read, and maintain My opinion is that Go is too simple, to the point that it hinders understanding and readability. 4 nested loops with random mutability is much worse…

It would be good for my job if learned go, but I've been having a hard time because it's just so boring.

You're doing it wrong if you think programming for work is about the code being a means of expressing your inner soul. The most successful professional programmers derive their enjoyment from achieving business objectives, like making products that users love and improve the world.

If you want to express your soul in your code, do that on the weekend using whatever language you want. Trying to mix these motivations is a recipe for disaster.

Re: Java 21 makes me like Java again

#656

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.

Using Discord for voice comms in CSGO on Ryzen 3600x w/ 32GB RAM had noticeable impact on my framerate, big enough that I refused to use for this purpose. No impact using Teamspeak. Both in Windows.

Re: Java 21 makes me like Java again

#657
post #645

Earlier quoted context omitted.

Teasing this apart I see a few things: a) logging, b) modules rollout and c) missing frameworks. I’ve never had a logging issue in large systems. Explicit error return (as you know, on every function) allows you to log in your code, not lean on only libraries that support your interface. Modules rollout was part of growing up. But, you won’t get Go 1->2 upgrade issues as we have 100% backward compatibility on version…

> Too many allocations for Go is going to be too many allocations for JVM too No, Go’s GC is a toy compared to the JVM’s. It is lowerish in latency by actually stopping the application threads when under high contention. Java doesn’t slow down the allocation rate, it tries to keep up with the churn.

Even it's latency is outclassed by ZGC and Shanandoah.

The GC monoculture is great from a simplicity and out of the box experience but there is a very good reason to a) want multiple different GCs tuned for different workload types and b) have competition so that the best designs can be found rather than having to fight to be the only implementation.

Re: Java 21 makes me like Java again

#658
post #493

Earlier quoted context omitted.

I've never seen Gradle run fast, even with the daemon running. Gradle itself can take multiple seconds to startup. God knows what it's doing.

Gradle is steaming pile of garbage. But since the zoomers are allergic to XML, Maven (actually fast) is slowly dying.

We are in the process of switching to Gradle at work and I'm not sure I like it. I used Gradle when building some OSS projects, but my experience wasn't that great.

Re: Java 21 makes me like Java again

#659

Earlier quoted context omitted.

Java, prints 1: Set s = new HashSet (); s.add( new File( "c:/temp" ) ); s.add( new File( "c:/temp" ) ); System.out.println( s.size() ); C#, prints 2: ISet s = new HashSet (); s.Add( new FileInfo( "c:/temp" ) ); s.Add( new FileInfo( "c:/temp" ) ); Console.WriteLine( s.Count ); C#, test fails: string path = "/tmp/filename.txt"; FileInfo f = new FileInfo( path ); File.CreateText( path ).Dispose(); Assert.True( f.Exists…

FilInfo doesn’t override Equal operator in C#. HashSet will use it for comparison and those are two different object references so idk what the confusion is here.

A set is a collection of objects in which order has no significance, and multiplicity is generally also ignored. Observing the code alone, it isn't obvious that two FileInfo instances having the same path are themselves not equal. As has been mentioned elsewhere, FileInfo should not be hashable to prevent declaring it as a Set, avoiding the situation entirely.

C# isn't flawless. Java isn't flawless.

Re: Java 21 makes me like Java again

#660
post #616

Earlier quoted context omitted.

Gradle is steaming pile of garbage. But since the zoomers are allergic to XML, Maven (actually fast) is slowly dying.

Gradle is much faster than maven as it can properly parallelize the workloads. Sure, it won’t be visible on a hello world, though.

I've never seen gradle be faster than Maven. I have no idea what purose its daemon serves or its promise to "parallelize workloads". Which workloads? Its purpose is to build the project, fast. It spends about a magnitude of time more just trying to start up, even with daemon running.
Post reply on HN