Live data from Hacker News

Java 12

jdk.java.net

321–330 of 478 posts

Re: Java 12

#321
post #95
post #6

The most interesting new feature I think is the Shenandoah GC. The summary from [1]: "Add a new garbage collection (GC) algorithm named Shenandoah which reduces GC pause times by doing evacuation work concurrently with the running Java threads. Pause times with Shenandoah are independent of heap size, meaning you will have the same consistent pause times whether your heap is 200 MB or 200 GB." The original algorithm…

How is memory efficiency? Usually faster and/or consistent GC performance comes at the cost of extra memory usage. (This is why I'm excited for ARC / Swift on the server...)

Go and C# running circles around Swift.

"35C3 - Safe and Secure Drivers in High-Level Languages"

https://www.youtube.com/watch?v=aSuRyLBrXgI

Re: Java 12

#322

Meanwhile, most enterprise apps still seem to only work with JRE 8. And those which I know of have elected to replace Java rather than upgrade.

Part of the issue is that a lot of libraries target jdk 8 since that's what Android supports.

Actually libraries that target Android need to use Java 7, unless they want to constrain their users to API 26+.

Re: Java 12

#323
post #99

Earlier quoted context omitted.

Yeah, that kinda makes it impossible to become a successor to Swing. But the situation actually got more sane because JavaFX can be included now as a Maven dependency, like any other framework.

Why do people still use Maven when Gradle exists? I'll never know.

Because Maven doesn't require a background daemon eating 2GB of memory to be fast and IDEs can actually provide code completion and documentation while typing.

Android is the only reason to have to put up with Gradle.

Re: Java 12

#324

Earlier quoted context omitted.

I'm not sure if you're trolling so I'll try to keep this short. Java is old, it's crufty. Yes. But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. The JVM is also extremely reliable. I've seen apps run for years straight. And the tooling is better than basically anything. Profiling, debugging, realtime code generation and modification. Libraries for…

> There's many valid critisicms of Java... Yes there are. ...but the parent assertion that Java will one day be like cobol; no longer taught in intro to CS course (where now we see python), considered bloated and legacy, and not picked for new projects (where we see the rise of languages like kotlin eating into what was once the primary growth for the language with mobile apps) and encumbered by problematic licensing…

Yes, the enterprise bubble where Java, .NET, C++ and JavaScript rule.

Re: Java 12

#325

Still nothing to handle checked exceptions in streams properly... sigh.

You should return some ResultOrError value instead of throwing Exception..

That's what languages like Rust do with a return return type that is part of the core language.

Sometimes I wish Java had one too to complement Optional. I wonder what the argument against that is? Too much confusion with the existing Exception system?

Re: Java 12

#326
post #5

Earlier quoted context omitted.

In case someone is curious what it looks like with the new -> form: switch (day) { case MONDAY, FRIDAY, SUNDAY -> System.out.println(6); case TUESDAY -> System.out.println(7); case THURSDAY, SATURDAY -> System.out.println(8); case WEDNESDAY -> System.out.println(9); }

or using the switch as an expression System.out.println(switch(day) { case MONDAY, FRIDAY, SUNDAY -> 6; case TUESDAY -> 7; case THURSDAY, SATURDAY -> 8; case WEDNESDAY -> 9; });

The number of times I've wished this was possible is probably 50% of the times I've used a switch statement.

Re: Java 12

#327
post #96

Earlier quoted context omitted.

"Presumably they meant Java in the client" Android?

They are talking about his https://en.wikipedia.org/wiki/Java_applet Which were absolutely everywhere at the turn of century.

Thanks to WebAssembly it is back.

http://teavm.org/

Re: Java 12

#328
post #91
post #27

Earlier quoted context omitted.

GC pauses have been one of the major barriers to using garbage collected (read: higher-level) languages for game development. This could open up the JVM for games, which could have some exciting implications.

Once upon a time the barrier was the existance of VMT tables and method dispatch. GC use can be optimized in high level languages with support for value types (which are still missing in Java, though) and it is not like every game needs to be the next Fortnight.

Only tangentially related to your comment, Fortnite is based on UE4 so it does use garbage collection. And it has caused framerate/hitching issues as recently as a year ago according to an Epic developer.

https://www.reddit.com/r/FortNiteBR/comments/7gu8aq/hitching...

Re: Java 12

#329

Earlier quoted context omitted.

> it's also lost the niches that brought it into existence Applets, JavaBeans, and CORBA. What a loss. > Besides being owned by Oracle, which is enough of a reason to never use Java ever again, That stopped being an issue years ago. OpenJDK is a thing, you know? > Java on the web is dead, I don't think you have any idea about the hundreds of millions of lines of Java that power the web as you know it today. The rest…

That stopped being an issue years ago. OpenJDK is a thing, you know? If Oracle's ridiculous interpretation of API copyrights holds up, they have a kill switch for OpenJDK.

Just like Google's ridiculous interpretation of the licenses of others being worthless.

https://www.youtube.com/watch?v=ZYw3X4RZv6Y&feature=youtu.be...

Re: Java 12

#330
post #314

Earlier quoted context omitted.

The times of ever-changing JavaScript frontend frameworks is long behind us (and, arguably, React has won for MVw-style browser apps). The core node.js web serving APIs (expressjs and core http request API, which expressjs middlewares forwards and decorates) is stable since node.js v0.1 or at least 2015, and infinitely better than Java's servlet, JSP, and taglib APIs (web.xml/jetty-config.xml anyone?). The flip side…

In all these years I have used Spring exactly once for an architecture prototype, during one month project. All our customers doing Java Web projects are either on JEE, or a CMS platform running on top of servlets and JEE related JSRs, like Liferay and AM.

I have no doubt it's working for you and your customers. But JEE and JSRs have been a dead end for many years now. When there are only single implementations for JSRs left, the whole exercise becomes pointless and masochistic, doesn't it?

In 2006 I played around with Jackrabbit for an architecture concept (for managing airworthiness of airplanes and kit). That was before the Iphone even existed. I was honestly surprised Adobe is still using it in their AEM product. From what I recall, it manages a document tree, based on a 2004-ish, Drupal-like node graph in typical Java enterprise fashion.

I'm no insider, but my guess is Adobe is struggling for some time now to integrate AEM, Magento, and other purchases into a lineup for creating shopping experiences. We'll see how this works out.

Post reply on HN