News for hackers. Stuff that matters.
Re:Thank You, Guido by alanfranz on Wednesday October 30, 2019 @12:11PM (#21399258)
Honestly: the Java environment is exceedingly good at that. Backwards incompatible changes are truly minimal, and only those that are strictly necessary are added.

And since Java 8 the language is pretty nice and offers good functional idioms.

Of course, major versions of libraries still change. But there's no match with the JS approach.

Re:Thank You, Guido by CamouflagedKiwi on Wednesday October 30, 2019 @01:30PM (#21400239)
Yet we have multiple versions of Java at work (8 and 11) because some (pretty large) third-party components don't support the newer versions yet. Plus for things that do work there are a bunch of irritating warnings and whatnot.

It's not "exceedingly good" at it, it's just alright. Go has done much better for us in this area.

Re:Thank You, Guido by hgtr on Wednesday October 30, 2019 @01:54PM (#21400511)
Go has the whole gomodules thing, which I’m not a huge fan of. Go with vendored dependencies sounds really stable.
Re:Thank You, Guido by hsaliak on Wednesday October 30, 2019 @03:28PM (#21401546)
Pretty sure generics are coming, and this is going to change best practices, and cause re-writes.
Re:Thank You, Guido by sheeshkebab on Wednesday October 30, 2019 @06:25PM (#21403546)
go mod vendor is what you are looking for then
Re:Thank You, Guido by lvh on Wednesday October 30, 2019 @12:49PM (#21399759)
I agreed until the disaster that was Jigsaw.

Maybe Jigsaw didn't impact you particularly hard, but you can't argue the JVM has a policy of minimal backwards incompatible changes given that debacle.

Re:Thank You, Guido by chrisseaton on Wednesday October 30, 2019 @01:00PM (#21399900)
I work on Java at a really deep level, and I haven't had to interact with Jigsaw at all. What is it breaking for you?
Re:Thank You, Guido by brabel on Wednesday October 30, 2019 @02:07PM (#21400666)
A lot of things like older versions of Gradle (which at some point was a blocker to move to Java 9, but not now), Groovy (also fixed, but still has some warnings), which we use heavily for tests, several reflection-heavy frameworks (think dependency injection, annotation-processors etc), which to this day require some ugly hacks like --patch-module to "open" packages, JUnit tests (which also need the same hacks to work), even the location of resources loaded with class.getResource() had to be modified when modularizing a jar, so that resources go into the proper packages that are visible to the loader...

You seriously didn't suffer any of these?

Re:Thank You, Guido by chrisseaton on Wednesday October 30, 2019 @05:05PM (#21402712)
No I didn’t experience any issues like that myself.
Re:Thank You, Guido by dhash on Wednesday October 30, 2019 @02:14PM (#21400741)
I’m a full time scala developer and have had basically no problems taking longer than a day to in moving to the LTS releases of 9+.

It’s probably pretty helpful that the scala ecosystem doesn’t depend much on non-well trodden parts of the JDK

Re:Thank You, Guido by jrs95 on Wednesday October 30, 2019 @12:24PM (#21399437)
The downside is that also means a lot of the core APIs are a huge pain in the ass to work with, especially relative to something like Python, and the “solution” to this problem ends up being something like Spring which has to use so much reflection and metaprogramming to accomplish what it does that it also relies heavily on exceptions for control flow. So without even getting into the other issues, debugging becomes a lot more complicated than it would be otherwise.

Personally I would second Go as a good answer for this. It has its limitations, but it’s simplicity and it’s standard library more than make up for that from a pragmatic standpoint imo

Re:Thank You, Guido by nine_k on Wednesday October 30, 2019 @12:37PM (#21399605)
Either you have a stable platform, and it reflects the state of the art form the year of its inception, or you have a platform that keeps on improving, but this means you need to change your code along with it, to keep up with the improvements.

You can't have it both ways,

OTOH current JVM can still correctly run bytecode compiled by Java 1.0.1 (or maybe even earlier), so the backwards compatibility is indeed excellent.

Re:Thank You, Guido by vbezhenar on Wednesday October 30, 2019 @03:10PM (#21401363)
Not necessarily. Java currently ships two date libraries, for example: java.util.Date and java.time.*. There are some duplicating classes like Vector from the old times and ArrayList from new times. There are two I/O frameworks: old I/O (File, FileInputStream, etc) and nio (Path, FileSystem, etc). While I don't like the particular way Java did that, basically you just have to ship all old versions and keep them working and ship new versions with some adapters to ease migration.
Re:Thank You, Guido by dragonwriter on Wednesday October 30, 2019 @04:18PM (#21402118)
> Either you have a stable platform, and it reflects the state of the art form the year of its inception, or you have a platform that keeps on improving, but this means you need to change your code along with it, to keep up with the improvements.

> You can't have it both ways,

You can have a continuously improving platform with full backward compatibility, and all the improvements that aren't just efficiency of established operations are opt-in.

Re:Thank You, Guido by mcny on Wednesday October 30, 2019 @12:59PM (#21399888)
I am not a go programmer but I would love to revisit this conversation but with golang twenty years from now. Please correct me if I am wrong but I believe golang is essentially complete, right? and golang programmers like golang?
Re:Thank You, Guido by Alupis on Wednesday October 30, 2019 @01:08PM (#21399984)
> Please correct me if I am wrong but I believe golang is essentially complete, right

I'm confident every programming language thought it was complete at some point... but eventually it's users demand some new "hot" feature and then you're back to releasing new versions again.

The C programming language just had a release in June 2018, C18. For a language released 47 years ago... and it's a pretty basic language compared to most other languages.

Fortran was released 62 years ago, and just released Fortran 2018 in November of 2018.

Re:Thank You, Guido by mongol on Wednesday October 30, 2019 @01:08PM (#21399987)
Go is not complete. But it does not evolve by revolution as of now.
Re:Thank You, Guido by Insanity on Wednesday October 30, 2019 @04:39PM (#21402409)
Complete is hard to define, no language stops evolving. But Go language is perfectly suitable for large projects, and is pretty much my Go-to nowadays. (Pun intended)
Re:Thank You, Guido by matwood on Wednesday October 30, 2019 @12:55PM (#21399830)
Java 8+ is so easy to work with I think it bores a lot of people so they go looking for something more. Spring boot + jooq is easy to work with and breaking changes are slow.

I'm also coming around on Go. The simplicity was a turn off at first, but now that I've used it to implement a graphql server I like the simplicity. I don't want to have to be a programming language researcher to quickly get work done. IMO Go delivers in that mission.

Re:Thank You, Guido by betaby on Wednesday October 30, 2019 @03:26PM (#21401533)
Java is paid platform without clear pricing, licensing and patents.
Re:Thank You, Guido by Discombulator on Wednesday October 30, 2019 @05:27PM (#21402965)
Many (most) JDK distributions are free for all usages and fully open source.

Can you give some references for the patents issue you mentioned?

Re:Thank You, Guido by betaby on Wednesday October 30, 2019 @06:03PM (#21403321)
So you agreed pricing and licensing is not clear? If still not, here is the source https://upperedge.com/knowledge-center/documents/oracle-podc... As for the patents I don't have a source quickly available. Pricing and licensing are already bad enough. If I sell java based software, customers have to worry about licensing from Oracle. If I sell SaS I have to worry for what and how to pay. Those factors are big risks.
Re:Thank You, Guido by Alupis on Wednesday October 30, 2019 @12:38PM (#21399623)
If you're using something like Spring or Spring-Boot (highly recommended!!!) - you rarely, if ever, are going to be debugging Spring's code... any issues are going to be in your code.

With Spring-Boot you can even start treating Spring and friends like a "Black Box", and stop caring about how it does what it does.

Re:Thank You, Guido by neeleshs on Wednesday October 30, 2019 @05:33PM (#21403011)
Could not agree more with Spring-boot recommendation! It's an amazing toolbox and combine it with streams and function interfaces, programming in Java is pleasant again
Re:Thank You, Guido by crtlaltdel on Wednesday October 30, 2019 @12:52PM (#21399799)
personally i loath blackbox systems, regardless of how well the docs are written. i want to know how it does things...even if only to satisfy my curiosity.
Re:Thank You, Guido by Alupis on Wednesday October 30, 2019 @01:02PM (#21399925)
It's not blackbox in that you can't look inside... it's blackbox in that you can choose to ignore it and be just fine.

Springboot takes an opinionated approach to a lot of things, but always lets you override it and do whatever you want wherever you want.

I suppose that's more of a greybox...

Re:Thank You, Guido by crtlaltdel on Wednesday October 30, 2019 @03:56PM (#21401842)
ah, yes! point taken.
Re:Thank You, Guido by vbezhenar on Wednesday October 30, 2019 @03:32PM (#21401590)
You can use Spring without all that magic. I, personally, hate Spring Boot and would never use it, exactly because of all that magic. But Spring itself is perfectly fine and I can control every single bit of it with explicit configurations.
Re:Thank You, Guido by neeleshs on Wednesday October 30, 2019 @05:31PM (#21402996)
For us, springboot gave about 90% of what we wanted out of the box. The 10% that we wanted customized (special authentication related things or transparent multitenant database switching with repositories etc), it let us override and do what we wanted it to do. It certainly is a lot of magic, but nothing that cannot be deduced if you are familiar with Spring, and/or look at the source.
Re:Thank You, Guido by Alupis on Wednesday October 30, 2019 @05:36PM (#21403038)
I used to be opposed to all the "magic"... but after you write a few MVC projects with Hibernate backends, etc... why keep having to do that all from scratch each time?

You end up making your own framework that has all that in it, so that you just change a few things here and there and can start getting to the business logic that much quicker.

Then you realize you're maintaining all of that code... when you'd much rather maintain the business logic bits...

Which leads to using Spring Boot and letting them maintain everything else.

Re:Thank You, Guido by outworlder on Wednesday October 30, 2019 @02:29PM (#21400914)
> Honestly: the Java environment is exceedingly good at that.

I would argue that the .NET Framework is way better. The way you can have multiple versions installed side by side and have the framework pick the correct one to run is awesome. Granted, you can do something similar with the JVM by mucking around with env vars, but it's not the same thing.

Re:Thank You, Guido by scarface74 on Wednesday October 30, 2019 @03:03PM (#21401286)
Well, .Net Framework is analogous to Python 2.7. It will never receive anything but compatibility, security, and bug fixes going forward according to MS.

The Future is .Net Core.

Re:Thank You, Guido by tahdig on Wednesday October 30, 2019 @06:13PM (#21403424)
Just for the sake of redundancy:

Python 2.7 is not getting any kind of updates including security and bugfixes.

Re:Thank You, Guido by vvillena on Wednesday October 30, 2019 @02:44PM (#21401066)
Not really. The newer open versions still don't match Oracle JDK 8. Wanna bundle a JVM with your app so your users don't have to worry about the Java runtime? Well, you can't do that anymore. Wanna use JavaFX? You have to jump to Java 11 and hope your dependencies don't fail with module packaging errors. Do you use Scala? GLHF.

Standing still in the Java ecosystem is fine. Keeping on with the advances is painful and exhausting. The Java tech stack is awesome when it works, but to solve issues you have to go so deep into the tech stack that I'm starting to think it just can't be done unless you're at least a mid-sized company with JVM specialists on the payroll. Not developers, but systems people.

Re:Thank You, Guido by sgift on Wednesday October 30, 2019 @03:30PM (#21401576)
> Wanna bundle a JVM with your app so your users don't have to worry about the Java runtime?

Why would that be the case?

> Wanna use JavaFX? You have to jump to Java 11 and hope your dependencies don't fail with module packaging errors.

Dependencies which still fail with module errors are basically abandoned and should probably be replaced. But even for those there's an escape hatch if you really want to continue using them, so that seems to be a non-issue?

> The Java tech stack is awesome when it works, but to solve issues you have to go so deep into the tech stack that I'm starting to think it just can't be done unless you're at least a mid-sized company with JVM specialists on the payroll. Not developers, but systems people.

I've worked either directly or indirectly with so many companies of all sizes using Java without any dedicated JVM specialists I'm pretty sure you're doing something very, very wrong with all the problems you seem to have.

Re:Thank You, Guido by vvillena on Thursday October 31, 2019 @09:24AM (#21408418)
> Why would that be the case?

I have a desktop Java app with platform-specific installers (.msi, .deb, .dmg). The Windows and Mac installers include a Java runtime, so the user doesn't have to worry about installing an external runtime. I'm forced to use Oracle JVM, because it's the only Java distribution that includes the tools needed. There's ongoing development on a tool that should bring these and more related features to the open JVMs, but it's not done yet.

> Dependencies which still fail with module errors are basically abandoned and should probably be replaced. But even for those there's an escape hatch if you really want to continue using them, so that seems to be a non-issue?

The issue is that the upgrade path isn't smooth. I have to upgrade everything at the same time, because what works on Java 11 doesn't work in Java 8, and viceversa. It makes everything way harder than it should be, if there was a clear migration path.

> I've worked either directly or indirectly with so many companies of all sizes using Java without any dedicated JVM specialists I'm pretty sure you're doing something very, very wrong with all the problems you seem to have.

What I do falls into a niche. It's not "very wrong" but it's uncommon. The main issue is that Java was a non-issue, a stable platform to build upon. But the recent Oracle license change forced us to move to fully open versions of Java that do not have the same features, do not bundle the same libraries, and do not have documentation detailing all these differences.

I'm not asking for a community to finish whatever feature I need, or for a company to make what I need free to use. I'm just trying to explain my own problems caused by Oracle forcing us to move to open distributions of the Java platform.

Re:Thank You, Guido by thomascgalvin on Wednesday October 30, 2019 @04:03PM (#21401917)
> The newer open versions still don't match Oracle JDK 8

I'm currently working on a web service that was written under Java 8.

For giggles, I just ran the end-to-end tests suite under Java 8, 11, and 13. The only error I got was an incompatibility with Google's Error Prone linter, which I was able to fix with one line change.

This represents a few hundred thousand lines of production code that works just fine under every important JDK in use today.

Re:Thank You, Guido by vvillena on Thursday October 31, 2019 @09:26AM (#21408445)
The problem isn't usually with the runtime itself, but with all the ecosystem and tools around it. This becomes very apparent when venturing beyond web services and you start depending on those tools.
Re:Thank You, Guido by alanfranz on Wednesday October 30, 2019 @04:23PM (#21402189)
> The newer open versions still don't match Oracle JDK 8.

Oracle JDK 8 contained some small parts that were proprietary. And they mostly had the proper package name. You took the risk.

> Wanna bundle a JVM with your app so your users don't have to worry about the Java runtime? Well, you can't do that anymore.

You mean, bundling a JVM exactly like all JetBrains IDEs currently do?

> Wanna use JavaFX? You have to jump to Java 11 and hope your dependencies don't fail with module packaging errors.

JavaFX is a bit of a strange thing, and yes, it can be painful. And some modules struggle with the new module system. The module system is a breaking change, and in fact it took quite a while.

> Scala

That's a problem with the Scala compiler AFAIK, not with Java.

Re:Thank You, Guido by vvillena on Thursday October 31, 2019 @01:51PM (#21411635)
> Oracle JDK 8 contained some small parts that were proprietary. And they mostly had the proper package name. You took the risk.

I did not. Some libraries I depend on did.

> You mean, bundling a JVM exactly like all JetBrains IDEs currently do?

Yes. I'm researching how they do it. Previously it could be done with one command. Jetbrains use their own patched JVM and have JVM experts on their payroll. What they do goes way beyond my current skills.

> That's a problem with the Scala compiler AFAIK, not with Java.

From a JVM point of view, Scala is just one more library. The problem with Scala right now is that it doesn't support the module system. This means yet another dive at a lower level to try to fix any issue that appears.

Re:Thank You, Guido by sigzero on Wednesday October 30, 2019 @03:34PM (#21401610)
That's a lot of FUD spewing.
Re:Thank You, Guido by vvillena on Thursday October 31, 2019 @09:06AM (#21408259)
It's my own personal and professional experience. Yours may differ, but please don't call it FUD.
Re:Thank You, Guido by chaostheory on Wednesday October 30, 2019 @01:55PM (#21400521)
How are people adapting to Oracle’s licensing changes?
Re:Thank You, Guido by brabel on Wednesday October 30, 2019 @02:21PM (#21400814)
The biggest change I've seen is that people are using OpenJDK itself (rather than Oracle's official distribution) a lot more, not only from the official OpenJDK distribution, but also the new Amazon's Corretto version, Azul's Zulu (the one I use at work, which has been backporting lots of security improvements to Java 8, which is very useful!), RedHat's OpenJDK, and even AdoptOpenJDK, all of which are completely free and open source...

If you want to quickly and easily switch between distributions, I highly recommend https://sdkman.io/ - it lets you install and use any of the above mentioned JVMs with a simple CLI... e.g. `sdk use 13.0.1.j9-adpt` or `sdk use java 8.0.232-zulu`.

I would guess that Oracle's JVM popularity has gone down from around 75% of Java users, to something like 20% after the changes, even though I don't actually have the numbers.

Re:Thank You, Guido by jakebasile on Wednesday October 30, 2019 @02:11PM (#21400701)
It's not really that big a deal in my experience. We switched to the Corretto[1] distribution of the OpenJDK from Amazon and it was seamless.

If you want newer versions of the JDK, you can get them directly from Oracle[2] still, or from alternatives like AdoptOpenJDK[3].

[1]: https://aws.amazon.com/corretto/

[2]: https://jdk.java.net/13/

[3]: https://adoptopenjdk.net

Re:Thank You, Guido by Marazan on Wednesday October 30, 2019 @04:13PM (#21402051)
Except, you know, fundamental stuff like how many cores does the JRE think it is running on.

The dance over that as we've gone from 8 to 9 to 10 to 11 is mind boggling.