Live data from Hacker News

Java.evolved: Java has evolved. Your code can too

javaevolved.github.io

11–20 of 40 posts

Re: Java.evolved: Java has evolved. Your code can too

#11
post #2

Great idea, although it is quite inconvenient that you have to tap/swipe to show the modern version (at least on mobile). Makes it difficult to compare.

Hey mate, what UX would you suggest? Happy to explore ideas! For a better visualization to compare old/new, just click on the card and it will open that particular pattern in a new page.

Click to toggle. Hard to go back to „old“ version on mobile.

Re: Java.evolved: Java has evolved. Your code can too

#12
post #9

Not many people know this, but you can also write public int x, y; instead of private int x, y; public int getX() {return x;} public void setX(int x) {this.x = x;} public int getY() {return y;} public void setY(int y) {this.y = y;} this is compatible with any language version

And the second you have anything other than a toy application you'll find out why getters, setters, and validation were invented, and why we them just moved everything to have consistent interfaces.

This is the meme where the Padawan exposes public fields, the intermediate says you must use setters and getters, and the Jedi just exposes public fields.

(Records kind of made this moot, and for the better)

Re: Java.evolved: Java has evolved. Your code can too

#13
post #2

Great idea, although it is quite inconvenient that you have to tap/swipe to show the modern version (at least on mobile). Makes it difficult to compare.

Hey mate, what UX would you suggest? Happy to explore ideas! For a better visualization to compare old/new, just click on the card and it will open that particular pattern in a new page.

What are you hiding information for? Just show both modes at the same time.

Re: Java.evolved: Java has evolved. Your code can too

#15

Cool. Java is catching up with Kotlin at last

Some of the improvements on that site were introduced in Java more than a decade ago.

Your attitude is exactly why I don't want to have to deal with the Kotlin ecosystem. The difference between Java and Kotlin in 2026 is negligible and the benefits don't weigh up to having to listen to Kotlin evangelists proclaiming it's superior the whole time.

Re: Java.evolved: Java has evolved. Your code can too

#17
post #2

Great idea, although it is quite inconvenient that you have to tap/swipe to show the modern version (at least on mobile). Makes it difficult to compare.

Hey mate, what UX would you suggest? Happy to explore ideas! For a better visualization to compare old/new, just click on the card and it will open that particular pattern in a new page.

Can you add a page where its just a list of all of them in a format like that? https://imgur.com/a/iO42lrs

I would love to just scroll through a page without having to click on individual cards to see both side by side.

Love the overall idea of what you did!

Re: Java.evolved: Java has evolved. Your code can too

#18
post #9

Not many people know this, but you can also write public int x, y; instead of private int x, y; public int getX() {return x;} public void setX(int x) {this.x = x;} public int getY() {return y;} public void setY(int y) {this.y = y;} this is compatible with any language version

I'm from the ancient years of Java, surely this must have started at some point ?

Do you get getters and setters ?

I left Java around version 5.

Re: Java.evolved: Java has evolved. Your code can too

#20

Earlier quoted context omitted.

And the second you have anything other than a toy application you'll find out why getters, setters, and validation were invented, and why we them just moved everything to have consistent interfaces.

This is the meme where the Padawan exposes public fields, the intermediate says you must use setters and getters, and the Jedi just exposes public fields. (Records kind of made this moot, and for the better)

Except records are immutable and have getters and setters as builtins to replicate what we've been doing with Lombok.

So enforces what I was saying.

Post reply on HN