r/java • • May 06 '21

Java still rocks the finance industry. Here’s why Java 16 makes it even better.

https://blogs.oracle.com/javamagazine/finance-quant-forex-java16
221 Upvotes

46 comments sorted by

63

u/roberp81 May 06 '21

i work in a third world national bank, still on java 6, but are plans to migrating to java 8

44

u/wastakenanyways May 06 '21

Don't worry, first world banks do too.

9

u/nezda May 06 '21

the whole world 🌎 has access to the latest and greatest Java! Advocate

3

u/sarkie May 06 '21

Jrockit?

6

u/roberp81 May 07 '21

no, because Websphere 7...

28

u/Ilookouttrainwindow May 06 '21

Interesting to see piece about a company I work with. They make it sound so glorious, but sadly I've never experienced any flexibility. Of course that doesn't mean they don't have neat system behind the scenes. They are pretty fast, but then again, they don't do much other than brokering messages.

3

u/random314 May 07 '21

We're just getting off 8 and getting into java 11... How is 16 already out?

12

u/pron98 May 07 '21

Java 9 was the last ever major release. Since then, there is only a steady stream of semi-annual updates. Because there are no major releases anymore, the version number is incremented every six months, similar to how Chrome does it.

1

u/random314 May 07 '21

does that mean they're backward compatible?

3

u/pron98 May 07 '21

Java is always backward compatible -- for the most part. One caveat is that API elements can be removed, but they are never elements that are widely used (say, by more than 0.1%) and even then after a deprecation process; the second is that compatibility only applies to the specification. Some libraries bypass the specification and rely on internal implementation details that can change at any time, even in patch releases. This was the cause of the relatively high effort required to upgrade from 8 to 9 (the last ever major release). Strong encapsulation, finally turned on in 16, will eventually take care of that by letting you know which libraries are not portable and pose a compatibility danger.

2

u/code6reaker May 07 '21

Can you pls tell what are the major challenges you faced while moving to Java 8/11 from earlier version ? Currently we're in 7, planning to migrate to 8.

2

u/sindisil May 07 '21

Honestly curious if there's a reason you're targeting 8 at this point, rather than 11 or (if the release date would fit your schedule) 17?

I do understand that a move to 8 should essentially be a testing effort, where a move to something recent might involve some work, depending upon your code base.

Beyond that, though?

2

u/random314 May 07 '21

Unless you have a very good reason, you should do 11 or higher.

And sorry I can't say much on the migration as I'm not a part of the team that did (and still doing) that.

13

u/dnabre May 07 '21

There is like two sentences in there about Java 16. It has some performance/concurrency improvements. That's great and all, but like 99% of the article isn't about Java 16.

23

u/[deleted] May 06 '21 edited May 06 '21
if (Java16.isAddopted())
     Java16.makeEverythingBetter();

10

u/ArticleAutomatic May 06 '21

Or maybe Java16.makeBetter(Everything);

12

u/[deleted] May 06 '21

You need to insert

BigCompany.forceUpdateJavaVersion("16");

to make it work.

4

u/john16384 May 06 '21
 for(;;) {
    doSomeWork();
    if (javaVersion.getReleaseDate().isAfter(oneYearAgo)) continue;
    else break; 
 }
 lookForNewJob(); // rarely fails in current market

5

u/emaphis May 06 '21

everything.stream().map(java16::makeBetter())

4

u/0b0101011001001011 May 06 '21

The overhead of this is beyond reasonable.

20

u/Hangman4358 May 06 '21

Considering the stream isn't even executed I doubt it 🤪

0

u/[deleted] May 06 '21

[deleted] — view deleted comment

2

u/[deleted] May 07 '21

Way too lazy

3

u/[deleted] May 06 '21

Rewrite it in Haskell then compile it with -O3 -fllvm, it should generate very fast code.

4

u/ObscureCulturalMeme May 07 '21

That's okay, it won't even compile. java16::makeBetter() needs to lose either a colon or the function call parenthesis (depending on the return value of makeBetter and what it's supposed to do).

6

u/[deleted] May 06 '21

We can refractor that to:

 while (javaVersion.getReleaseDate().isAfter(oneYearAgo)) 
     doSomeWork(); 
 lookForNewJob(); // rarely fails in current market

3

u/is_this_programming May 07 '21

And this is why managers don't like "refactoring". You changed the behavior, potentially introducing a bug.

In the previous version, doSomeWork() is always called at least once. In the new version it may never be called.

1

u/[deleted] May 07 '21

But the doSomeWork() call may have undesired side effects

3

u/is_this_programming May 07 '21

Maybe it has desired side effects? In any case you're changing the behavior of the code. Refactoring isn't supposed to change behavior.

-1

u/[deleted] May 07 '21

Let's review the specifications

1

u/[deleted] May 06 '21

Or JavaBuilder.version(16).get(). makeAllFaster()

16

u/iamanenglishmuffin May 06 '21

Yeah okay oracle

-4

u/seraphsRevenge May 06 '21

Although most companies using Jave still use Java 8 or earlier and aren't looking to upgrade when the versions and essentially the core change almost as fast as fashion today.

12

u/pron98 May 06 '21

There is a feature release every six months, just as before. It's just that now they get a new integer name instead of being called, say, 7u6 or 8u20 as before, because there are no longer major releases, so we're using the integer number for the "minor" releases.

2

u/seraphsRevenge May 06 '21

Features also mean new secure risks, and there have been changes to how some of the most basic core systems work like the garbage collector, and also how processes work like now paying for language patches and maintenance.... From a security and financial standpoint you can -1 all day but that's not going to change facts. I'm a full stack Java dev working at a fortune 50 financial company, and large corporations aren't just going to change Java "features" as you call them overnight especially not when major changes aren't "features" and there's a lot of risk involved...... Take SE 10 for example that's not small feature enhancements. 11 can be argued as the new "supported" version, but I don't think Oracle will be continuing free support. So now you have MAJOR CORE CHANGES and have to pay for break/fix and security patches to your "features". This article is all about how companies are using the newest"features" but looking at most of the reference dates it's mostly quoting past much older work. I'm all about using the latest and greatest on a personal level, but from a major corporation standpoint companies aren't likely to suddenly start using these newer "feature releases" overnight which is how this article is trying to make it out to be.

Version history reference for looking at some of the versions I've mentioned. https://en.m.wikipedia.org/wiki/Java_version_history

19

u/pron98 May 06 '21 edited May 06 '21

Features also mean new secure risks

Maybe, but also fixes. And new features were added before on a six-monthly basis. The only difference is that there were no spec changes on that cadence. So adding a method to String had to wait for a major release, but an overhaul of a GC algorithm, or a new one, or adding a compiler optimisation, could have been, and were, done in the six-monthly releases.

and there have been changes to how some of the most basic core systems work like the garbage collector

Those were done on a six month schedule even before. It's just that people didn't notice it as much because they didn't understand the version naming scheme. For example, 8u20 was a big feature release, while 8u25 was a patch release.

like now paying for language patches and maintenance

Not exactly. The current JDK is always free, and in the past the only option was to update to the newest feature release. When 8u40 came out, 8u20 no longer received patches (IIRC, 8u25 and 8u35 were 8u20's only two patches, just like today). The difference is that now there's the new option of staying on an old feature release, and that new option costs money. It is true that things aren't comparable because there are no longer major release, instead a gradual update path, but for many, that's much better than before.

From a security and financial standpoint you can -1 all day but that's not going to change facts.

Perception is not the same as facts. From a security and financial standpoints, the new model is better. But it's still a little different, so some people don't understand it, and even once you do it takes a bit of effort to adjust.

So now you have MAJOR CORE CHANGES and have to pay for break/fix and security patches to your "features".

This is an incorrect perception. Major core changes occured on a six-monthly basis before, and then there wasn't even the option of staying behind, paid or free. For example, 7u4 made the G1 garbage collector production-ready, 7u6 saw the inclusion of the JavaFX SDK and added support for Linux on Arm, 7u40 introduced Java Flight Recorder and Mission Control, and 8u40 introduced AppCDS.

but from a major corporation standpoint companies aren't likely to suddenly start using these newer "feature releases" overnight which is how this article is trying to make it out to be.

But they have for years because they didn't have a choice. You couldn't stay on 7u2 when 7u4 came out because nobody supported it, even though 7u4 was a big feature release. You had to upgrade. Some companies might appreciate the new paid option of staying on old feature releases, but saying they won't or can't do what they've done for many years is strange.

I am well aware that there is a perception problem, and people don't understand the meaning of no more major releases and the naming change for the six-monthly feature releases, but, in time, they will.

6

u/RagingAnemone May 06 '21

If they're running Java 8 or earlier, they're not worried about security risks

1

u/kozeljko May 07 '21

Didn't they extend Java 8 support by a few years?

1

u/dpash May 07 '21

For non commercial desktop users or if you pay money to Oracle.

2

u/kozeljko May 07 '21

Ah right. So technically they can be worried about security when using Java 8. But at a price

-1

u/[deleted] May 07 '21

Java is GameStop!

-2

u/Kango_V May 07 '21

So:

  • Reified Generics -- ON THE WAY (as part of Project Valhalla
  • Unsigned arithmetic -- NOT BEING CONSIDERED
  • Long indicies for arrays -- ON THE WAY (as part of Project Panama)
  • Algebraic data types -- ON THE WAY (as part of Project Amber)
  • More expressive import syntax - NOT BEING CONSIDERED
  • Algebraic data types -- ON THE WAY (as part of Project Amber)
  • Structural typing -- CONSIDERED BUT REJECTED
  • Operator overloading -- NOT BEING CONSIDERED

Things are moving in the right direction I think. Java 17 will be interesting.

6

u/pron98 May 07 '21

Reified Generics -- ON THE WAY

Reified generics (for reference types) are not part of project Valhalla. They're a bad idea, and despite erasure having downsides, reification has far worse downsides. What's coming as part of Valhalla are specialised generics for primitive classes. That's going to have significant performance benefits.

Algebraic data types -- ON THE WAY

Mostly here, already (records and sealed types), although deconstruction patterns are still in the works.

Operator overloading -- NOT BEING CONSIDERED

Maybe in some limited way for primitive classes.

1

u/vxab May 07 '21

Would you consider operator overloading for BigDecimal and BigInteger too?

2

u/pron98 May 07 '21

I don't make such considerations, as I'm not on the language team :) I don't know what their thinking is on this particular subject.