[flagged]
Having worked extensively in Java, Node, and Python, I’ll take the JVM ecosystem absolutely any day of the week. Me and my catheter will be over here delivering actual software while you figure out how React 32 broke your transcompiler.
Java 21 makes me like Java again
111–120 of 777 posts
Re: Java 21 makes me like Java again
#112Earlier quoted context omitted.
`Executor.newVirtualThreadPerTaskExecutor` versus `go` really gets to the heart of why I think that Go developers aren't going to be switching. edit: Sorry, it's actually: try (var executor = Executors.newVirtualThreadPerTaskExecutor()) { executor.submit(...) ) instead of `go`
So basically executor.submit(). And you still have a language that is significantly less verbose than go, objectively.
Re: Java 21 makes me like Java again
#113Earlier quoted context omitted.
There is nothing wrong with inheritance. But sure, there is usually something wrong with deep inheritance or using it, where better solutions exist.
No, there's a lot wrong with inheritance. It leads to all sorts of issues and while theoretically one can keep the tree 1 level deep, in practice it's too tempting to expand the hierarchy. This is one of Java's big issues. The other is reference equality as a default, pretty horrible. Records help but records are also limited in when they can be used.
Re: Java 21 makes me like Java again
#114Earlier quoted context omitted.
Having worked extensively in Java, Node, and Python, I’ll take the JVM ecosystem absolutely any day of the week. Me and my catheter will be over here delivering actual software while you figure out how React 32 broke your transcompiler.
Except I’m over here serving 10x the traffic with 10x less cloud spend on CPU and Memory for hosts.
Re: Java 21 makes me like Java again
#115The problems with Java can't be fixed by adding new things, you can't undo decades of ecosystem development, training, and ideology built on top of the idea that inheritance is really good idea and belongs everywhere. edit: I will say that as a Java developer I am grateful every day for the improvements to the language. Java is a very impressive language and I have a lot of respect for the people working on it.
Prefer composition over inheritance has been a common mantra for at least a decade, if not more. Maybe you should undergo the last decade of development and training. There will always be shitty devs, and since java is one of the biggest languages, it definitely has more than some ultra niche academic language no one uses. I don't think it is the fault of the language though, or if that somehow were a reason to choos…
> Should a decent BMW driver sell their car, because plenty assholes buy that car also?
A better analogy would be "Should you drive on the street where all of the shitty drivers do donuts and street races?"
Re: Java 21 makes me like Java again
#116Earlier quoted context omitted.
Please ELI5 what is wrong with inheritance and/or how Java have it wrong. Do we need to go back to a new object oriented undegraduate course? Genuinely asking.
With compositions A uses B but B can never use A. With inheritance Child can use the Parent, but Parent will also call the Child (virtual methods) which in turn can call the Parent again etc.., so the code can become difficult to follow. It can become very complicated with multiple inheritance and multiple levels.
Re: Java 21 makes me like Java again
#117Earlier quoted context omitted.
No, there's a lot wrong with inheritance. It leads to all sorts of issues and while theoretically one can keep the tree 1 level deep, in practice it's too tempting to expand the hierarchy. This is one of Java's big issues. The other is reference equality as a default, pretty horrible. Records help but records are also limited in when they can be used.
You don't like code reuse?
Re: Java 21 makes me like Java again
#118Earlier quoted context omitted.
Exactly what is enterprise? I think Java has a role to play in most professional settings, even if the company is quite small. It is not a sports car but I see it more as a truck or a cargo ship. Vehicles that underpin the world economy, but that only few think of as fun or exciting. Not pretty or nice to look at, but reliable work horses.
It is for sure the wagoneer when it comes to getting things done in the enterprise, if it was 2005. It’s not a sports car, it’s not a dune buggy, it’s not even pretty in its wood paneling and drab paint scheme. But it got your family to Wisconsin for the holidays. In 2023, we have better options.
Re: Java 21 makes me like Java again
#119Earlier quoted context omitted.
No, there's a lot wrong with inheritance. It leads to all sorts of issues and while theoretically one can keep the tree 1 level deep, in practice it's too tempting to expand the hierarchy. This is one of Java's big issues. The other is reference equality as a default, pretty horrible. Records help but records are also limited in when they can be used.
You don't like code reuse?
Re: Java 21 makes me like Java again
#120Earlier quoted context omitted.
`Executor.newVirtualThreadPerTaskExecutor` versus `go` really gets to the heart of why I think that Go developers aren't going to be switching. edit: Sorry, it's actually: try (var executor = Executors.newVirtualThreadPerTaskExecutor()) { executor.submit(...) ) instead of `go`
Wrap it in class Go { static void go(…) } and it will look better with “import static”