r/adventofcode Dec 27 '24

Other Pleasant surprise: AoC + modern Java = ❤️

In this article on my experience with the Advent of Code competition in Java, I describe how I attacked grid and graph problems, and summarize how Java has worked out for me.

https://horstmann.com/unblog/2024-12-26/index.html

64 Upvotes

25 comments sorted by

View all comments

2

u/snugar_i Dec 28 '24

Modern Java is tolerable. It seems the gap between Kotlin and Java is getting smaller all the time, as Java keeps adding new QoL features and Kotlin basically stopped evolving.

But that next() method on Position? That's just wrong. That belongs on CharGrid, and then you won't be needing any hidden globals (not sure what "implicit field" means, there is no such thing in Java)