Live data from Hacker News

Java 21 makes me like Java again

wscp.dev

551–560 of 777 posts

Re: Java 21 makes me like Java again

#551
post #547

Earlier quoted context omitted.

Why async/await is not a good thing? What makes green threads better? Do you know the difference, the issues async/await addresses that green threads simply do not?

This is code with async/await: async fn read_file(filename): f = await os.open(filename) let data = f.read() await f.close() return data this is equivalent code with green threads: fn read_file(filename): f = os.open(filename) let data = f.read() f.close() return data As you can see, async/await is pure syntactic noise, it doesn't convey any important meaning.

Async enables clear contract for a type that represents a delayed result.

Better implementations offer eager execution and allow to easily interleave multiple concurrent futures/tasks, like C#. Green threads on the other hand are a workaround to deal with blocking for the most trivial case of cooperative multi-tasking, offering little beyond that.

Re: Java 21 makes me like Java again

#552
post #542

The biggest problem with Java is... the walled garden, the snob society, the elitist, exclusive culture. Go isn't like that, or at least wasn't when G+ was still around. Nowadays I don't get in touch much with people, but when I create issues Go people are usually not as unfriendly as Java/JVM people.

> The biggest problem with Java is... the walled garden, the snob society, the elitist, exclusive culture. No idea how you have managed to come to such a conclusion, or what kind of experienced you might have had. I have been part of some of the core JSR/groups, as rather independent/unaffiliated (not oracle/google/hp/ibm/twitter) - there was no gate keeping, elitism or anything alike. I'd consider mailing lists extr…

Agreed, I have never seen a pattern of elitist behavior unique to the Java ecosystem.

There are always people like that when groups get big enough.

The thing I love about the JVM ecosystem is the engineering culture. The quality of the platform and most libraries is very high, and well designed.

I don't love the Java language, but it can get the job done.

Re: Java 21 makes me like Java again

#553
post #526

Earlier quoted context omitted.

I don't think any existing Go developer is going back to Java. I worked with Java for 10 years and switched to Go and I will never go back. 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. Go is simple. It's easy to understand, read, and maintain. The packaging is like how you would package files on your co…

I did. Did Go professionally for ~5 years and went to JVM. Go is easy, but it's surface level easy. Building and maintaining large applications in Go if you don't have a huge team is a giant pain. JVM (especially paired with Kotlin) for me atleast has meant regaining the expressivity I was missing from Ruby and Python when I moved to Go whilst retaining (well actually usually beating) it on performance and scalabilit…

> JVM (especially paired with Kotlin)

I agree the Go lang compiler/runtime needs "a Kotlin", with more null-safey build in, proper sum types, a std lib that makes heavy use of null-safety and sum types, better story for polymorphism, better ergonomics for writing stream pipelines, and additional compilation targets (like JS, WASM). This all while proving stellar interop with all Go code, obviously.

Kotlin is quite a sweet deal.

Re: Java 21 makes me like Java again

#554
post #526

Earlier quoted context omitted.

I don't think any existing Go developer is going back to Java. I worked with Java for 10 years and switched to Go and I will never go back. 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. Go is simple. It's easy to understand, read, and maintain. The packaging is like how you would package files on your co…

I did. Did Go professionally for ~5 years and went to JVM. Go is easy, but it's surface level easy. Building and maintaining large applications in Go if you don't have a huge team is a giant pain. JVM (especially paired with Kotlin) for me atleast has meant regaining the expressivity I was missing from Ruby and Python when I moved to Go whilst retaining (well actually usually beating) it on performance and scalabilit…

Going on 12 years with Go and agree with everything.

Re: Java 21 makes me like Java again

#555

The biggest problem with Java is... the walled garden, the snob society, the elitist, exclusive culture. Go isn't like that, or at least wasn't when G+ was still around. Nowadays I don't get in touch much with people, but when I create issues Go people are usually not as unfriendly as Java/JVM people.

Java? Elitist...?

Maybe it's true for Haskell or Rust. But Java?

Re: Java 21 makes me like Java again

#556
post #422
post #278

Earlier quoted context omitted.

> not so great if you want to distribute software for people who are not software savvy, who typically just wants to download one file, install and start using it. i think it's a flaw that wasn't considered properly in the standard java toolchain to not produce an embedded java runtime into a final packaged artifact that is self-executable. You end up with third party tooling like: https://www.ej-technologies.com/res…

It has existed for 20 years, and already started with Sun. Having AOT compilers as commercial offerings, was seen as one way to capture value in the Java market, in a culture where most compilers were still commercial, GCC being the exception.

>It has existed for 20 years, and already started with Sun.

In an anemic way, with mostly third party offerings few people know or care about, and various degrees of pain and shortcoming to their use. It should be a first class feature, and as simple to use as is in Go (including for cross compiling).

In general, if something exists in "some form" for 30+ years in a language, and only a handful of people use it, whereas in another it's used all the time and people from other languages are jealous of how well it works, then the formers "some form" is not a good one.

Re: Java 21 makes me like Java again

#558

Earlier quoted context omitted.

I’m referring to this guideline: > Variable names in Go should be short rather than long. This is especially true for local variables with limited scope. Prefer c to lineCount. Prefer i to sliceIndex. https://github.com/golang/go/wiki/CodeReviewComments#variabl...

One of those is not like the other... lineCount is literally perfect meanwhile sliceIndex could be anything.

[deleted]

Re: Java 21 makes me like Java again

#559
post #526

Earlier quoted context omitted.

I don't think any existing Go developer is going back to Java. I worked with Java for 10 years and switched to Go and I will never go back. 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. Go is simple. It's easy to understand, read, and maintain. The packaging is like how you would package files on your co…

I did. Did Go professionally for ~5 years and went to JVM. Go is easy, but it's surface level easy. Building and maintaining large applications in Go if you don't have a huge team is a giant pain. JVM (especially paired with Kotlin) for me atleast has meant regaining the expressivity I was missing from Ruby and Python when I moved to Go whilst retaining (well actually usually beating) it on performance and scalabilit…

I’ve got to disagree with this strongly. I built and operated the same large system in both languages (acquisition forced me to rewrite) and both the dev and operating cost of the JVM was much higher.

Go is a high velocity language. Code reviews on language/style issues are non existent, it’s GC is blazing fast (not our experience with JVM) and it’s really easy to read. I’ve watched many new engineers ramp up on both systems, as both operated side by side for a while, Go was inevitably faster for engineers.

What made maintaining Go hard for you?

Re: Java 21 makes me like Java again

#560
post #506

Earlier quoted context omitted.

Your issue seems to be with packages provided by Microsoft, not C# language itself. Model builder magic is part of those packages, not C# language. These types of libraries often make simple things quick and easy, but complex things (or just simple customization) much harder or even impossible.

I've seen this response before, but why on earth would we be using C# if not for its included batteries? I can't imagine a world where we would have chosen C# to write an API unless there were some specific benefits, and while I may be wrong to assume this, I don't think I've ever met someone who would. Not so much because there is anything wrong with C# or .Net for that matter, it's okish, it's just well... Honestly…

I agree with you that the choice of language should not be based solely on the language itself, but also on the ecosystem it provides for the task you need to complete.

I was just pointing out that your critique was about the included batteries, not the language. Every language has some bad libraries in its ecosystem.

Post reply on HN