RSS Amplifier

Blog

Cay Horstmann's Unblog

I am a professor of computer science and wrote many professional and college books on Java, Scala, other programming languages, and introductory programming. In this blog, I share the occasional tidbit of useful information or rant about the latest injustice in the worlds of Java and computer science education.

horstmann.comRSS feed ↗10 posts

Latest posts

Nice and Naughty Cases of Pattern Matching

Since Java 14, the Java switch and instanceof statements have been enhanced, in multiple phases, to support pattern matching and a "data-oriented" programming style. In this article, also published in the Java Advent Calendar, I explore when this programming style is beneficial, and why. I look at the sweet spot of perfect pattern usage, absolute antipatterns where it should not be used, no matter…

Help! My LocalDate Isn’t Flattened

Project Valhalla promises to flatten objects in the Java virtual machine. Of course, it is much better to have an array of fifty million values than fifty million object references, each with a header and the value. Just before giving a presentation about that at the JFall conference, I saw an article at inside.java that promised such flattening with an array of LocalDate objects. But I could not…

One Small Step for Maven

The fabulous JCrete unconference ends with a “hack day”. I never thought I could contribute anything useful in a few hours, but this year Maurice Naftalin and myself succeeded. Version 3.6.0 of the exec-maven-plugin contains the fruit of our labor. Now you can use Maven to execute an “instance main method”.

Emacs, LSP, and Java, Together at Last

I like to use Java for small programming tasks. Without ceremony. Without a src/main/java directory tree. It works great with modern Java and VS Code. VS Code isn’t a complete IDE, but it relies on the Language Server Protocol (LSP) to talk to the Eclipse LSP server. Of course, VS Code is unremarkable as a text editor. It’s no Emacs. But the combination of Emacs, LSP, and Java can be a science…

Java 25: The Nice, the Meh, and ...

When a new “long term support” release of Java comes out, I like to reflect on what improvements that it brings are nice, meh, ugly, or otherwise remarkable. Now we have Java 25, and here are my totally unbiased opinions.

German Driving Licenses for Expats

Are you living in Germany? As an expat, for an extended time? With a license from your home country? Do you feel the urge to speed along the autobahn once in a while? After six short months, you'll need a German driving license. Not a problem, right? Well, this is Germany. Read on for the gory details.

When I Abandoned the Vehicle

This year, Java One (super nice experience, BTW) was at Oracle Headquarters in Redwood Shores, so I rented a car in order to better navigate the peninsular wilderness. When the car failed to start, things got very weird. Here is the drama in 5 acts.

Teaching Java is Getting Simpler

I just talked to a professor who is using “Big Java”, my college textbook for beginning programmers. The professor had useful suggestions for improvement in the ebook. Since I had the chance, I asked “Are you planning to switch to Java 25 so that your students can use the simple onramp features? Should I cover them in the next edition?” Blank stares ensued. Since I obsessively track all Java…

Exploring DeepSeek with the Crazy Cheeze Puzzle

Having learned about DeepSeek, the new kid on the AI chatbot block, I tasked it with writing a solver for an annoying puzzle. I was surprised how well it did, quite a bit better than the current state of the art. Check out the code that it produced as I kept challenging it. Reading and evaluating code, rather than writing it, is what we will all need to get better at. The code snippets are…

Lessons from Advent Of Code - Part 4: Grids and Graphs

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