Cay Horstmann
cayhorstmann@foojay.social
<p>In my copious spare time I write books and develop online courses for beginning and professional programmers.</p>
Posts
-
Post #2920950
My article &quot;Effective Pattern Matching 2026 Edition&quot; is now live at https://javapro.io/2026/03/24/effective-pattern-matching-2026-edition/
-
Post #2920949
Is there any AI software that can watch a boring compliance video (emergency procedures, nondiscrimination, hazard communication, etc.) and answer the multiple choice questions that check for comprehension? Asking for a friend...
-
Post #2920948
I never thought much about hash codes of Java enumeration constants, but https://4comprehension.com/enum-map-serialization/ set me straight. Turns out enum hash codes are not stable, so serializing them as map keys will not work. Remedy: EnumMap!
-
Post #2920947
I just finished my talk at JCON—When Greed is Good: Understanding Java Stream Performance. The title attracted a good crowd. Slides at https://horstmann.com/presentations/2026/jcon/
-
Post #2920946
At JCON, a speaker&#39;s slides had a mysterious reference to &quot;danger to the herd&quot;. My preferred search engine (Kagi) led me to https://www.reddit.com/r/ProgrammerHumor/comments/azubgl/kantega_the_mysterious_life_of_developers/ I had a good laugh at the &quot;cliché developer with a conference t-shirt&quot;. Guilty as charged.
-
Post #2128656
PSA about white space in modern Java. Character::isWhitespace and String::strip are aligned. Stay away from legacy Character::isSpace and String::trim. But the regex &quot;(?U)\\s&quot; differs in eight code points: 28, 29, 30, 31, (Information separator 4...1) pass isWhiteSpace and not \s. Conversely, 133 (Next line), 160 (No-break space ⚠), 8199 (Figure space), 8239 (Narrow no-break space) don&#39;t pass isWhiteSpace but match \s.
-
Post #1244745
I&#39;ve been paying #Kagi for search since it&#39;s worth my time to get results instead of ads and slop. Added benefit: their translate service is fantastic for language learners. Where Google Translate gives the minimum, Kagi goes all out.
-
Post #793787
Github gives you until April 24 to opt out of using your Copilot interactions for model training. The setting is at the bottom of https://github.com/settings/copilot/features: Allow GitHub to use my data for AI model training.