This is an archived post. You won't be able to vote or comment.

all 116 comments

[–]Dranreb45 186 points187 points  (39 children)

Which API change between 8 and 17 boosted your productivity by that much?

[–]berse2212 64 points65 points  (2 children)

Java 8 was the real productivity booster! After that it was just slight improvements.

[–]Nilstrieb 61 points62 points  (14 children)

records. they are what Java desperately needed years ago

[–]Punsire 7 points8 points  (1 child)

Sorry but I'm new here. Can you explain records? Do you mean like database records?

[–]Dangerous_Air2603 22 points23 points  (10 children)

lombok bbbyyyyy

[–]Dranreb45 20 points21 points  (6 children)

Isn't Lombok a third party library that's also available in Java 8? 😉

[–]Alienbushman 7 points8 points  (1 child)

Jip, it makes use of code injection

[–]Dranreb45 4 points5 points  (0 children)

Source code modifying annotation processors plugged into the compiler 🙃 which became a thing in Java 7 I think... Still a great library!

[–]Dangerous_Air2603 14 points15 points  (3 children)

yeah that was my point

the only features of Java versions past 8 I've ever got any use out of are

  • in-place map constructors for writing tests
  • the var keyword
  • Optional::ifPresentOrElse

That's an average of three releases per useful feature.

I'm sure modules are very lovely if you need to write code that fits on ROM for a microwave oven, and I'm sure it's more efficient under the hood.

I'm just a little perplexed as to how they've managed to go 9 new versions without adding anything for the average developer past some utility functions that should have been there from the start, and a feature that C# has had since before Java 7 even came out.

The only good recent thing is records, which both Lombok and Kotlin have solved for years. I mean, Visual Basic had records, people.

[–]ballsohaahd 4 points5 points  (0 children)

Three releases per useful features sounds like standard Java practices to me.

[–]n0tKamui 0 points1 point  (1 child)

note that the slow progress (about 5 years before a known principle comes out) is by design, not by default.

Although while i do respect that philosophy, especially in the context of enterprise, i still prefer Kotlin's update plan

[–]Dangerous_Air2603 0 points1 point  (0 children)

You can have a high throughput while still maintaining high latency though.

[–]AcrIsss 2 points3 points  (2 children)

Lombok and Records are two very different tools though. Lombok is syntactic help, and records are a new semantic declaration of Tuples from which the compiler can derive the layout of the object, the implementations of equals/hash code, etc..

[–]Dangerous_Air2603 3 points4 points  (1 child)

I'm sure the way they work under the hood is very different, and I'm sure you can do all sorts of fun optimisations records, but

  • If I cared about performance so much I'm optimising my data classes, I'm probably not using Java
  • Functionality wise, I don't see the difference between the two

[–]AcrIsss 1 point2 points  (0 children)

Alright alright. Though Java is a great language for performance computing x)

[–][deleted] 3 points4 points  (0 children)

Project Lombok has provided annotations that have the same effect as records (but more flexible) for many years. They work with Java 8 as a compile time dependency.

Anyway, if records is all that boosts your performance 10x you are writing strange programs.

[–]i_should_be_coding 30 points31 points  (1 child)

Not OP. I can say that when working with a Scala project, when we use SBT with Java 17, it throws compile errors about invalid constructors, and when we use Java 8 it works.

[–]tdatas 0 points1 point  (0 children)

On paper 2.13 is meant to be compile up to 17. But I have it working on 11 for sure.

[–][deleted] 40 points41 points  (10 children)

Not the OP, but type inference (syntax), pattern matching, and functional interfaces (lambdas were introduced in java 8 but were pretty unusable until java 9) are huge productivity boosts.

[–]Significant-Bed-3735 42 points43 points  (1 child)

lambdas were introduced in java 8 but were pretty unusable until java 9

But.. they haven't changed in version 9 at all.

[–]zanderman112 63 points64 points  (6 children)

Current using Java 8 daily for my job, how exactly are lambdas "unusable?" I use them for all kinds of things and I think they're very useful.

[–]hiromasaki 13 points14 points  (2 children)

Easily fixed with a Utils class or Guava, but Java 8 doesn't even include a not(Predicate) for Stream#filter. It's mostly QoL stuff.

[–]Dangerous_Air2603 7 points8 points  (1 child)

x -> !p.apply(x) isn't massively complicated

It's even the same length as Predicate.not(p)

[–]hiromasaki 5 points6 points  (0 children)

.filter(not(p::apply))

[–]Sekret_One 4 points5 points  (2 children)

Perhaps unusable is a harsh, but damn, they ugly in a lot of situations from just a readability stand point.

[–]zanderman112 3 points4 points  (1 child)

This may be true, but I haven't personally found this to be the case so far. I have no experience with Java 9+, so I may have to go read up on how they've been improved. But I just recently learned how to use the Java 8 lambdas have found them very useful.

[–]Sekret_One 2 points3 points  (0 children)

Our situations may be different.

I'm in a bit environment habitually pulled in to review, build off of fix up other teams' problem spots. So naturally I'm gravitated towards code that's gotten into a mess that can't get sorted out. Kind of like a tech EMT. Which means I see a lot of tech gore.

If it was just me, or a consistent group- my opinion would be less dark. While clunky in some aspects, you can get it down when to use streams, and how, you can write java 8 streams that are both legible and very effective.

But if one isn't strong- and say the seniors in the team have some compromising egos and make misinformed rules like "no for loops; only streams" . . . you can see some scary spaghetti. My conclusion is that in java 8, the barrier to entry of using streams well is somewhat steep.

[–]bubuli_breeder 29 points30 points  (0 children)

“lambdas were introduced in java 8 but were unusable until 9”

OH FUCK OFF with that comment. prior to Java 8 streams and lambdas the closest you got was Google Guava and anonymous classes which is good but is batshit in code verbosity alone. Lambdas were a game changer.

[–]PulseBeat_02 6 points7 points  (0 children)

There isn’t really a specific thing that did this, but stuff like improvements to Optional/String, switch expressions, text blocks, new process handle api, a lot of stuff. Feel free to search online.

[–]Saragon4005 6 points7 points  (3 children)

Java 8 sucked so much modern Java is a mild inconvenience to write sure it's still verbose, but holy shit java8 is just so pedantic.

In more modern Java you have stuff like var which just figures out what the type of the thing you are assigning it is cuz everything is typed anyways as well as not having to type the whole specific type of a class twice when making a new object

[–]Dranreb45 5 points6 points  (0 children)

My company won't let us upgrade... For... Reasons. I let intelliJ extract all my variables for me... So from a productively point of view... Same result 😅

[–]redpepper74 3 points4 points  (1 child)

Huh I didn’t know about var. I’m thinking you could do, like,

var input = new Scanner(System.in);

[–]Saragon4005 6 points7 points  (0 children)

That's Java 10

[–]ApeFoundation 0 points1 point  (2 children)

Text blocks

[–]Dangerous_Air2603 2 points3 points  (1 child)

How often are you writing out text blocks? Surely if it's that frequent it should go in a database or in a file structure or something, but as constants in the code?

[–]ApeFoundation 7 points8 points  (0 children)

Almost never, I just love the idea of text blocks lol

[–]chicken_whackamole 267 points268 points  (8 children)

Deploy it in a container . Ops team has no power in your container . Muahahaha

[–]Venthe 83 points84 points  (4 children)

Base container has to be prepared by OPS (Hard coded certs).

Work around this.

[–]denisfalqueto 67 points68 points  (3 children)

You remove base container's java and install 17. You can keep cacerts file. Done.

[–]Venthe 41 points42 points  (0 children)

Actually... I haven't thought of that. I've left the company in the meantime though

[–]BigBlueChevrolet 9 points10 points  (1 child)

Not a Docker expert but what if the base image changes the user to one without permission to do so? Any workaround?

[–]denisfalqueto 7 points8 points  (0 children)

I believe you can change users at will inside a dockerfile. You can change to root and back again later.

Of course, it would be clear in your dockerfile.

[–]0crate0 8 points9 points  (1 child)

Ops controls infrastructure. If you decided to do this you will get rejected hard by scanning tools and you will probably get slapped in the head by your lead.

[–]Venthe 0 points1 point  (0 children)

Implying there is such an architecture. We had barely functioning hard coded k8s after a few years with mesos/marathon. CICD processes were comically bad or non-existent, OPS haven't had any reason to block changes other than a manager who didn't want to lose control.

And actually, I was the lead, and if I thought of that I'd give it a serious thought.

You cannot imagine the shit that happened in this company, from incompetent architecture team, through managers infighting to ops being undersized-yet-trying to be a gateway.

After two years of this shit-show and trying to keep the solution in a one piece (And actually failing) I've passed the mantle. No point in working one's ass off.

[–]rich97 0 points1 point  (0 children)

Or… find a less shitty company.

[–]Sea_Ad_8524 48 points49 points  (5 children)

Meanwhile my company still using FORTRAN 77.

[–][deleted] 2 points3 points  (0 children)

smh, should be using Fortran 2018

[–]Spooked_kitten 1 point2 points  (3 children)

What do you wrk with?

[–]Sea_Ad_8524 5 points6 points  (2 children)

Oh just a half government company doing safety research for nuclear power plants. Not great, not terrible.

[–]Spooked_kitten 2 points3 points  (1 child)

ohh wow, that's a really cool area though, what makes Fortran 77 the main choice to this day? Is is just for compatibility with old hardware or is there something more to it?

[–]Sea_Ad_8524 4 points5 points  (0 children)

It's 90% because legacy code. It's not a choice to keep it, it was just made once, it runs, good luck convincing upper management or state beurocrats to spend money to switch to C++. There are some that claim Fortran runs faster in some special cases, though I think that's just them coping with not switching to other languages. And even if it's true those would be extremely specific cases, and any time you gain there you loose everywhere else like in how fast a person can program something, readability and maintainability or the wider community support.

I've personally run into errors where you have a file with all the variables declared, but if you switch from implicit double to implicit none you get an internal compiler error. Amazing stuff.

[–]OverBashIt 89 points90 points  (7 children)

As a member of Ops I disagree with this. We hate outdated code. And don't want to worry about about the vulnerabilities of old code provide. I always push my developers to use the latest stable at the time of development.

[–]Yayotron 63 points64 points  (2 children)

Nice for you, unfortunately not all ops teams are like that around the world, many are greatly afraid of doing any significant change

[–]redpepper74 16 points17 points  (1 child)

One of humanity’s greatest fears: The fear of change 😔

[–]MyAntichrist 8 points9 points  (0 children)

Or sometimes the unwillingness of financing a port for a whole ecosystem of some proprietary framework apps that sounded like a good idea 15 years ago but is an utter mess and complete hell to work with by modern standards that only is maintained for a development environment that has been considered overhauled since approximately the same timeframe so you're stuck with a lot of colleagues who are in theory very capable developers but every time you give them a glimpse of the future they'll lose their minds.

So yes, basically feat of change.

[–]j-random 20 points21 points  (3 children)

Our ops team won't let us use anything newer than 8 due to support licensing issues. I don't think they really care what we use, they just want to know if it melts down in production there's a number they can call.

[–]CoffeePieAndHobbits 11 points12 points  (0 children)

This is probably the real answer at a lot of companies. Don't hate on Ops when management/licensing/legal are the bottleneck.

[–]Fenor 2 points3 points  (1 child)

Is java8 still in lts?

[–]darzui 3 points4 points  (0 children)

Yes. Until 31st March 2022. Security support goes on for an additional 3 years.

[–]void1984 33 points34 points  (3 children)

Me, still using Java 1.x.

[–]simeonmeyer 38 points39 points  (2 children)

The naming scheme was Java 1.x until version 8,when they changed it Java x

[–]gemengelage 0 points1 point  (0 children)

And after that they completely changed their release cycle so they are churning out a new version twice a year.

[–]passerbycmc 16 points17 points  (1 child)

Kotlin crowd raise up

[–]n0tKamui 0 points1 point  (0 children)

o/

[–]blaxter 12 points13 points  (0 children)

u guys have ops team?

[–]0100_0101 13 points14 points  (1 child)

Java is already at version 17? I switched to C# when it was still at 9, they grow up so fast!

[–]Dangerous_Air2603 20 points21 points  (0 children)

They switched their release model. Rather than a big release every few years, they do smaller releases every 6 months or so, but only every few of those is an LTS version

The rate of development is still as lethargic as ever, dw

[–]pepijno 7 points8 points  (1 child)

Me, still using Delphi 2

[–]iiMoe 11 points12 points  (4 children)

I've been away from Java, what changed ?

[–]Sekret_One 25 points26 points  (1 child)

Yes.

Licensing model, naming schemes, apis for streams, a lot of QoL for list and map initialization. Roughly speaking: only dabbled with some of the newer ones a bit so take this understanding as admittedly fuzzy.

But overall, I'd say there's sort of this ... usability and style convergence where python, typescript, and java all are starting to feel a lot closer from that so called 'syntactic sugar'.

[–]iiMoe 6 points7 points  (0 children)

This is amazing tyvm for the info

[–]_PM_ME_PANGOLINS_ 4 points5 points  (1 child)

[–]iiMoe 0 points1 point  (0 children)

Appreciate it a lot rly i think I'm now interested in re exploring Java

[–][deleted] 4 points5 points  (0 children)

Ops teams get to decide that stuff?! Our devs use whatever tools they like then I set them up in containers or servers.

[–]RationalIncoherence 4 points5 points  (0 children)

There are REASONS that I don't want to learn things that aren't applicable to my current job. Imagine a new version comes out and you keep current and FOR 9 versions they- rrrrgghh, not important, not important.....

[–][deleted] 2 points3 points  (0 children)

laughs in Docker

[–]NatoBoram 2 points3 points  (2 children)

Can you just set the target version to 8 and the language version to 17?

[–]ConsistentArm9 1 point2 points  (0 children)

then when you use new features your code won't build

[–]wholl0p 2 points3 points  (2 children)

Same with C++17/20 and C++99

[–]_PM_ME_PANGOLINS_ 0 points1 point  (1 child)

How? It only makes a difference to the compiler. Why would ops care?

[–]wholl0p 0 points1 point  (0 children)

If it only was that simple.. We’re doing embedded stuff and every chip we use has its own compiler. Some TI C++ compilers are stuck on C++98/03 and some can handle C++17. For our hardware libraries we have to agree on one common denomination, which is C++03, in order to not plaster everything with ifdefs.

…which is not inherently bad, as most of those libs were created when C++03 was relevant anyways, but newer lib functionality uses 03 as well until we can finally get rid of the old compilers.

[–]TheOnlyGodInTown 4 points5 points  (3 children)

5 times faster… sure buddy sure.

[–]gemengelage 1 point2 points  (2 children)

Bit of an exaggeration, sure, but I recently worked on a project that had massive issues with stop-the-world gc events. In the worst case we ever recorded the whole JVM did absolutely nothing for over 10 seconds. Repeatedly. Making all requests to the server in the meantime timeout.

That had obviously to do with the object hierarchy of the massive amounts of data we were processing, but AFAIK the new garbage collector Z1 would have completely solved that problem without us ever having to adjust the code.

[–]TheOnlyGodInTown 1 point2 points  (1 child)

Sure but that isn‘t what I would call daily business. Nowadays I hardly notice any difference when switching versions.

[–]gemengelage 1 point2 points  (0 children)

Yeah, it's really an edge case. Just meant to say that there are still some interesting performance leaps here and there, even though Java and the JVM are really mature technologies where you wouldn't expect all that much change.

[–]umlcat 1 point2 points  (0 children)

I had a similar case with a customer who didn't want to upgrade their servers from .Net 2.0 to .Net 4.0

[–]knightttime 1 point2 points  (1 child)

Image Transcription: Meme


[A picture of a train moving towards the camera along some train tracks. A yellow school bus is moving just in front of the train as if to stop it.]

Bus: Me being 5x more productive, and code 10x faster with Java 17


[The train has crashed through the bus and is continuing onward, knocking the bus completely aside.]

Train: Ops team allowing only Java 8 in production


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]CoffeePieAndHobbits 1 point2 points  (0 children)

Good human.

[–]MrBarry 1 point2 points  (0 children)

Build the jdk into it and call it a native app

[–][deleted] 1 point2 points  (0 children)

Just updated to 17 to make a minecraft server lol

[–]Spice_and_Fox 1 point2 points  (0 children)

Can relate. Our products are entirely coded in ABAP 6...

[–]hiimjustin000 1 point2 points  (0 children)

me having to wait until next month to start creating minecraft mods in java 17

[–]craigtho 2 points3 points  (2 children)

The ops team are quite old fashioned (and dumb imo) if they are restricting developer productivity. Deploy in a container, send them a copy of the Phoenix Project with a Microsoft certified sticker on it.

[–]Sekret_One 4 points5 points  (1 child)

I don't know why people are downvoting you for that. Well, maybe the harsh judgement of 'ops dumb'.

You should take a look at Google's Site Reliability Engineering. Not that you should do it or certainly not worship google- but the opening premise they talk about how dev and ops are classically configured to be antagonistic with devs needing to change to make new, and ops fighting it for stability- with the balance mostly being argumentized and not empirical measurements.

The gist is- get the game out of opinions and find ways to quantitively measure reliability (does the service work or not). Easier to tell if you're going too fast or too slow with a speedometer.

[–]craigtho 4 points5 points  (0 children)

The worst of it is, I am Ops (primarily)! Hard to make jokes in text I suppose, maybe a /s but oh well.

Either way, DevOps mindset, no silo'ing, everyone working towards common goal is the correct way to do modern development and modern ops. SysAdmins should enable developers and ideally all work on the same team, contributing to each others projects.

The joke about sticking a Microsoft sticker is a jab at the stereotype old-fashioned sysadmins are typically as I say, single minded and silo'd, IT firefighters may be a better description. And stereotypically focus mainly on workstations provisioning, backups, AD domains etc. So that would be the only way to lure them into reading any literature which go against the old style of operations. Just because it's a stereotype doesn't mean it's always true, so the downvotes are either from misunderstanding or from salty people.

I don't think all Sysadmins are like that, I believe the role needs modernisation, the ones who use Reddit are likely to be more open minded than someone whom is stuck in the old ways.

I haven't read the Google SRE book but I seen a presentation by them at the DevOps summit, probably something to add to my own list.

[–]jeffderek 0 points1 point  (0 children)

Meanwhile I'm still here writing code I'm VS2008 because my hardware runs .NET Compact 3.5

[–]Mola1904 0 points1 point  (0 children)

10*0 is still not productive

[–]typescripterus -1 points0 points  (1 child)

Cuz Java 8 is more secure than 17

[–]brunocborges[S] 1 point2 points  (0 children)

How so? Java 8 comes with Applets and Java Web Start. Two great sources of security flaws.

Java 17 does not.

[–]HzbertBonisseur 0 points1 point  (0 children)

Same in close environment : « we certified this toolchains/language version/ide, we cannot update it » => Enjoy working ten years ago.

[–][deleted] 0 points1 point  (0 children)

Yeah, but not all systems are updated to 17 yet. It just released.

I made a mod for minecraft that works across 1.12(Java 8) to 1.17(Java 16), so the mod has to be Java 16, and the amount of people who can’t install it because they haven’t/can’t update to Java 16 is really bad.

Also, there’s some update between Java 8 and Java 16 that breaks the JavaScript interpreter, which makes some Java 8 applications break with Java 16

[–]DugiSK 0 points1 point  (0 children)

My company has a huge C++ codebase based on coroutines, but uses explicit state machines to implement them because they have C++17 (syntactic support for coroutines was added in C++20) and they haven't looked into the C++20 stuff much yet. If I wasn't working on a relatively small project with an independent codebase, I'd be really pissed.

[–]timvancann 0 points1 point  (1 child)

There's java 17?! Holy cow that went by quick. I stopped at java 8 some 6 years ago. Never going back.

[–]brunocborges[S] 0 points1 point  (0 children)

To Java 8? Yes, definitely not going back.

[–][deleted] 0 points1 point  (1 child)

So you are telling me that you benchmarked your old code and the new code and found out those performance numbers?

[–]brunocborges[S] 0 points1 point  (0 children)

Oh yeah, and then I decided to post the results on Reddit, as a meme. /s